You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nathan F. <nf...@au...> - 2010-06-25 15:45:45
|
Update the exisitng code base to use the new is_librtas_error() routine. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/Makefile.am | 6 ++-- src/Makefile.in | 12 ++++----- src/ppc64_cpu.c | 24 +++++++++++++++---- src/rtas_ibm_get_vpd.c | 59 ++++++----------------------------------------- src/serv_config.c | 20 ++++++++++++---- src/set_poweron_time.c | 61 +++++++------------------------------------------ 6 files changed, 61 insertions(+), 121 deletions(-) Index: powerpc-utils/src/Makefile.am =================================================================== --- powerpc-utils.orig/src/Makefile.am 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/Makefile.am 2010-06-25 09:10:59.000000000 -0500 @@ -16,10 +16,10 @@ usysattn_SOURCES = usysident.c librtas_error.c librtas_error.h usysattn_LDFLAGS = -lrtas -set_poweron_time_SOURCES = set_poweron_time.c +set_poweron_time_SOURCES = set_poweron_time.c librtas_error.c librtas_error.h set_poweron_time_LDFLAGS = -lrtas -rtas_ibm_get_vpd_SOURCES = rtas_ibm_get_vpd.c +rtas_ibm_get_vpd_SOURCES = rtas_ibm_get_vpd.c librtas_error.c librtas_error.h rtas_ibm_get_vpd_LDFLAGS = -lrtas serv_config_SOURCES = serv_config.c librtas_error.c librtas_error.h @@ -39,5 +39,5 @@ lsprop_SOURCES = lsprop.c -ppc64_cpu_SOURCES = ppc64_cpu.c +ppc64_cpu_SOURCES = ppc64_cpu.c librtas_error.c librtas_error.h ppc64_cpu_LDFLAGS = -lrtas Index: powerpc-utils/src/Makefile.in =================================================================== --- powerpc-utils.orig/src/Makefile.in 2010-06-25 09:13:43.000000000 -0500 +++ powerpc-utils/src/Makefile.in 2010-06-25 09:13:43.000000000 -0500 @@ -60,7 +60,7 @@ nvram_LDADD = $(LDADD) nvram_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(nvram_LDFLAGS) \ $(LDFLAGS) -o $@ -am_ppc64_cpu_OBJECTS = ppc64_cpu.$(OBJEXT) +am_ppc64_cpu_OBJECTS = ppc64_cpu.$(OBJEXT) librtas_error.$(OBJEXT) ppc64_cpu_OBJECTS = $(am_ppc64_cpu_OBJECTS) ppc64_cpu_LDADD = $(LDADD) ppc64_cpu_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(ppc64_cpu_LDFLAGS) \ @@ -70,7 +70,7 @@ rtas_event_decode_LDADD = $(LDADD) rtas_event_decode_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(rtas_event_decode_LDFLAGS) $(LDFLAGS) -o $@ -am_rtas_ibm_get_vpd_OBJECTS = rtas_ibm_get_vpd.$(OBJEXT) +am_rtas_ibm_get_vpd_OBJECTS = rtas_ibm_get_vpd.$(OBJEXT) librtas_error.$(OBJEXT) rtas_ibm_get_vpd_OBJECTS = $(am_rtas_ibm_get_vpd_OBJECTS) rtas_ibm_get_vpd_LDADD = $(LDADD) rtas_ibm_get_vpd_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -80,7 +80,7 @@ serv_config_LDADD = $(LDADD) serv_config_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(serv_config_LDFLAGS) $(LDFLAGS) -o $@ -am_set_poweron_time_OBJECTS = set_poweron_time.$(OBJEXT) +am_set_poweron_time_OBJECTS = set_poweron_time.$(OBJEXT) librtas_error.$(OBJEXT) set_poweron_time_OBJECTS = $(am_set_poweron_time_OBJECTS) set_poweron_time_LDADD = $(LDADD) set_poweron_time_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -231,9 +231,9 @@ usysident_LDFLAGS = -lrtas usysattn_SOURCES = usysident.c librtas_error.c librtas_error.h usysattn_LDFLAGS = -lrtas -set_poweron_time_SOURCES = set_poweron_time.c +set_poweron_time_SOURCES = set_poweron_time.c librtas_error.c librtas_error.h set_poweron_time_LDFLAGS = -lrtas -rtas_ibm_get_vpd_SOURCES = rtas_ibm_get_vpd.c +rtas_ibm_get_vpd_SOURCES = rtas_ibm_get_vpd.c librtas_error.c librtas_error.h rtas_ibm_get_vpd_LDFLAGS = -lrtas serv_config_SOURCES = serv_config.c librtas_error.c librtas_error.h serv_config_LDFLAGS = -lrtas @@ -246,7 +246,7 @@ nvram_SOURCES = nvram.c nvram.h nvram_LDFLAGS = -ldl lsprop_SOURCES = lsprop.c -ppc64_cpu_SOURCES = ppc64_cpu.c +ppc64_cpu_SOURCES = ppc64_cpu.c librtas_error.c librtas_error.h ppc64_cpu_LDFLAGS = -lrtas all: all-recursive Index: powerpc-utils/src/rtas_ibm_get_vpd.c =================================================================== --- powerpc-utils.orig/src/rtas_ibm_get_vpd.c 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/rtas_ibm_get_vpd.c 2010-06-25 09:10:59.000000000 -0500 @@ -26,6 +26,7 @@ #include <stdlib.h> #include <ctype.h> #include <librtas.h> +#include "librtas_error.h" #define PROC_FILE_RTAS_CALL "/proc/device-tree/rtas/ibm,get-vpd" #define BUF_SIZE 2048 @@ -91,55 +92,6 @@ } /** - * librtas_error - * @brief check for any librtas specific return codes - * - * This will check the error code provided to see if it matches any of - * the librtas specific return codes and add any text explaining the error - * to the buffer if a match is found. - * - * @param error return code from librtas call - * @param buf buffer to fill with librtas error message - * @param size size of buffer - */ -void librtas_error (int error, char *buf, size_t size) -{ - switch (error) { - case RTAS_KERNEL_INT: - snprintf(buf, size, "No kernel interface to firmware"); - break; - case RTAS_KERNEL_IMP: - snprintf(buf, size, "No kernel implementation of function"); - break; - case RTAS_PERM: - snprintf(buf, size, "Non-root caller"); - break; - case RTAS_NO_MEM: - snprintf(buf, size, "Out of heap memory"); - break; - case RTAS_NO_LOWMEM: - snprintf(buf, size, "Kernel out of low memory"); - break; - case RTAS_FREE_ERR: - snprintf(buf, size, "Attempt to free nonexistant RMO buffer"); - break; - case RTAS_TIMEOUT: - snprintf(buf, size, "RTAS delay exceeded specified timeout"); - break; - case RTAS_IO_ASSERT: - snprintf(buf, size, "Unexpected I/O error"); - break; - case RTAS_UNKNOWN_OP: - snprintf(buf, size, "No firmware implementation of function"); - break; - default: - snprintf(buf, size, "Unknown librtas error %d", error); - } - - return; -} - -/** * delete_list * @brief free all of the elements on a list * @@ -243,8 +195,13 @@ return 2; default: delete_list(list); - librtas_error(rc, err_buf, ERR_BUF_SIZE); - fprintf(stderr, "Could not gather vpd\n%s\n", err_buf); + if (is_librtas_error(rc)) { + librtas_error(rc, err_buf, ERR_BUF_SIZE); + fprintf(stderr, "Could not gather vpd\n%s\n", err_buf); + } else { + fprintf(stderr, "Could not gather vpd\n"); + } + return 3; } } while(rc != SUCCESS); Index: powerpc-utils/src/serv_config.c =================================================================== --- powerpc-utils.orig/src/serv_config.c 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/serv_config.c 2010-06-25 09:10:59.000000000 -0500 @@ -716,9 +716,15 @@ sysparm, var->nvram_var); return RC_PARAM_ERROR; default: - librtas_error (rc, err_buf, ERR_BUF_SIZE); - err_msg(ERR_MSG, "Error retrieving %d (%s)\n%s\n", + if (is_librtas_error(rc)) { + librtas_error (rc, err_buf, ERR_BUF_SIZE); + err_msg(ERR_MSG, "Error retrieving %d (%s)\n%s\n", sysparm, var->nvram_var, err_buf); + } else { + err_msg(ERR_MSG, "Error retrieving %d (%s)\n", + sysparm, var->nvram_var); + } + return RC_LIB_ERROR; } @@ -865,9 +871,15 @@ var->sysparm_num); return 0; default: - librtas_error (rc, err_buf, ERR_BUF_SIZE); - err_msg(ERR_MSG, "Error updating %d\n%s\n", + if (is_librtas_error(rc)) { + librtas_error (rc, err_buf, ERR_BUF_SIZE); + err_msg(ERR_MSG, "Error updating %d\n%s\n", var->sysparm_num, err_buf); + } else { + err_msg(ERR_MSG, "Error updating %d\n", + var->sysparm_num); + } + return 0; } } Index: powerpc-utils/src/set_poweron_time.c =================================================================== --- powerpc-utils.orig/src/set_poweron_time.c 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/set_poweron_time.c 2010-06-25 09:10:59.000000000 -0500 @@ -57,6 +57,7 @@ #include <ctype.h> #include <string.h> #include <librtas.h> +#include "librtas_error.h" #define PROC_FILE_RTAS_CALL "/proc/device-tree/rtas/set-time-for-power-on" #define PROC_FILE_MAX_LATENCY "/proc/device-tree/rtas/power-on-max-latency" @@ -149,56 +150,6 @@ } /** - * librtas_error - * @brief parse a return code from librtas for librtas specific errors - * - * @param error return code from librtas - * @param buf buffer to write error string into - * @param size size of "buffer" - */ -void librtas_error (int error, char *buf, size_t size) { - switch (error) { - case HARDWARE_ERROR: - snprintf(buf, size, "Hardware error"); - break; - case PARAMETER_ERROR: - snprintf(buf, size, "Parameter error"); - break; - case RTAS_KERNEL_INT: - snprintf(buf, size, "No kernel interface to firmware"); - break; - case RTAS_KERNEL_IMP: - snprintf(buf, size, "No kernel implementation of function"); - break; - case RTAS_PERM: - snprintf(buf, size, "Non-root caller"); - break; - case RTAS_NO_MEM: - snprintf(buf, size, "Out of heap memory"); - break; - case RTAS_NO_LOWMEM: - snprintf(buf, size, "Kernel out of low memory"); - break; - case RTAS_FREE_ERR: - snprintf(buf, size, "Attempt to free nonexistant RMO buffer"); - break; - case RTAS_TIMEOUT: - snprintf(buf, size, "RTAS delay exceeded specified timeout"); - break; - case RTAS_IO_ASSERT: - snprintf(buf, size, "Unexpected I/O error"); - break; - case RTAS_UNKNOWN_OP: - snprintf(buf, size, "No firmware implementation of function"); - break; - default: - snprintf(buf, size, "Unknown error from librtas call: %d", error); - } - - return; -} - -/** * get_current_epoch * @brief get the current time * @return current time @@ -426,8 +377,14 @@ utc->tm_mon+1, utc->tm_mday, utc->tm_hour, utc->tm_min, utc->tm_sec, 0); if (rc) { - librtas_error(rc, error_buf, ERROR_BUF_SIZE); - fprintf(stderr, "Could not set power-on time\n%s\n", error_buf); + if (is_librtas_error(rc)) { + librtas_error(rc, error_buf, ERROR_BUF_SIZE); + fprintf(stderr, "Could not set power-on time\n%s\n", + error_buf); + } else { + fprintf(stderr, "Could not set power-on time\n"); + } + return 4; } Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2010-06-25 09:08:54.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2010-06-25 09:14:19.000000000 -0500 @@ -15,6 +15,7 @@ #include <sys/stat.h> #define _GNU_SOURCE #include <getopt.h> +#include "librtas_error.h" #define SYSFS_CPUDIR "/sys/devices/system/cpu/cpu%d" #define INTSERV_PATH "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s" @@ -399,12 +400,19 @@ if (!run_mode) { rc = rtas_get_sysparm(DIAGNOSTICS_RUN_MODE, 3, mode); if (rc) { - if (rc == -3) + if (rc == -3) { printf("Machine does not support diagnostic " "run mode\n"); - else + } else if (is_librtas_error(rc)) { + char buf[1024]; + + librtas_error(rc, &buf[0], 1024); + printf("Could not retrieve current diagnostics " + "mode,\n%s\n", buf); + } else { printf("Could not retrieve current diagnostics " "mode\n"); + } } else printf("run-mode=%d\n", mode[2]); } else { @@ -420,14 +428,20 @@ rc = rtas_set_sysparm(DIAGNOSTICS_RUN_MODE, mode); if (rc) { - if (rc == -3) + if (rc == -3) { printf("Machine does not support diagnostic " "run mode\n"); - else if (rc == -9002) + } else if (rc == -9002) { printf("Machine is not authorized to set " "diagnostic run mode\n"); - else + } else if (is_librtas_error(rc)) { + char buf[1024]; + + librtas_error(rc, &buf[0], 1024); + printf("Could not set diagnostics mode,\n%s\n", buf); + } else { printf("Could not set diagnostics mode\n"); + } } } |
From: Nathan F. <nf...@au...> - 2010-06-25 15:44:24
|
Create a new is_librtas_error() routine that lets users know if the supplied error is a librtas specific return code. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/librtas_error.c | 21 +++++++++++++++++++-- src/librtas_error.h | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) Index: powerpc-utils/src/librtas_error.c =================================================================== --- powerpc-utils.orig/src/librtas_error.c 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/librtas_error.c 2010-06-25 09:10:12.000000000 -0500 @@ -22,8 +22,7 @@ * @param buf buffer to fill with error string * @param size size of "buffer" */ -void -librtas_error (int error, char *buf, size_t size) +void librtas_error(int error, char *buf, size_t size) { switch (error) { case RTAS_KERNEL_INT: @@ -60,4 +59,22 @@ return; } +int is_librtas_error(int error) +{ + int rc = 0; + + switch (error) { + case RTAS_KERNEL_INT: + case RTAS_KERNEL_IMP: + case RTAS_PERM: + case RTAS_NO_MEM: + case RTAS_NO_LOWMEM: + case RTAS_FREE_ERR: + case RTAS_TIMEOUT: + case RTAS_IO_ASSERT: + case RTAS_UNKNOWN_OP: + rc = 1; + } + return rc; +} Index: powerpc-utils/src/librtas_error.h =================================================================== --- powerpc-utils.orig/src/librtas_error.h 2010-06-25 09:00:41.000000000 -0500 +++ powerpc-utils/src/librtas_error.h 2010-06-25 09:10:12.000000000 -0500 @@ -12,5 +12,6 @@ #define _LIBRTAS_ERROR_H void librtas_error(int, char *, size_t); +int is_librtas_error(int); #endif |
From: Nathan F. <nf...@au...> - 2010-06-25 15:41:56
|
Updated patch to add a missed %c that should be a %d. This patch corrects the parameter handling of ppc64_cpu when setting the run-mode. The PAPR specifies that the rtas_[get|set]_system_parameter calls take a char buffer, but for the run mode it actually wants integer values in the buffer, not strings. This updates the handling of the values to be integers. This patch also add an additional error message to indicate failure when a partition is not authorized to set the run mode. Signed-off-by:Nathan Fontenot <nf...@au...> --- src/ppc64_cpu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2010-06-25 09:05:43.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2010-06-25 09:08:54.000000000 -0500 @@ -406,12 +406,12 @@ printf("Could not retrieve current diagnostics " "mode\n"); } else - printf("run-mode=%c\n", mode[2]); + printf("run-mode=%d\n", mode[2]); } else { - signed char rmode = *run_mode; + short rmode = atoi(run_mode); - if (rmode < '0' || rmode > '3') { - printf("Invalid run-mode=%c\n", rmode); + if (rmode < 0 || rmode > 3) { + printf("Invalid run-mode=%d\n", rmode); return -1; } @@ -423,6 +423,9 @@ if (rc == -3) printf("Machine does not support diagnostic " "run mode\n"); + else if (rc == -9002) + printf("Machine is not authorized to set " + "diagnostic run mode\n"); else printf("Could not set diagnostics mode\n"); } |
From: Nathan F. <nf...@au...> - 2010-06-24 16:26:28
|
On 06/24/2010 08:21 AM, Roman Rakus wrote: > Hi all, > there are missing man pages for the following binaries; > > /usr/sbin/drmgr > /usr/sbin/lsdevinfo > /usr/sbin/lsprop > /usr/sbin/lsslot > /usr/sbin/ppc64_cpu > /usr/sbin/rtas_event_decode > > > Some can be generated from help2man. Is there any plan to create them? Yes, some of these commands should have man pages for them. Some, like drmgr, don't necessarily need a manpage as it is a command that is not meant to be run by users. -Nathan > > RR > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2010-06-24 16:02:25
|
On 06/21/2010 04:53 PM, Brad Peters wrote: > Yeah, that's probably a better spot for it. Can you copy/paste, or do you need > another patch? This should be easy enough to copy/paste into the man page. -Nathan > > -Brad > > Nathan Fontenot wrote: >> On 06/18/2010 01:15 PM, Brad Peters wrote: >>> Adding some of description of the update_flash related error events covered in >>> BZ 64797, which is an understandably confusing situation >>> >> >> Would this fit better in the man page for update_flash? >> >> I personally don't have a preference, more just curious. >> >> -Nathan > |
From: Roman R. <rr...@re...> - 2010-06-24 13:22:37
|
Hi all, there are missing man pages for the following binaries; /usr/sbin/drmgr /usr/sbin/lsdevinfo /usr/sbin/lsprop /usr/sbin/lsslot /usr/sbin/ppc64_cpu /usr/sbin/rtas_event_decode Some can be generated from help2man. Is there any plan to create them? RR |
From: Brad P. <bp...@li...> - 2010-06-21 21:54:15
|
Yeah, that's probably a better spot for it. Can you copy/paste, or do you need another patch? -Brad Nathan Fontenot wrote: > On 06/18/2010 01:15 PM, Brad Peters wrote: >> Adding some of description of the update_flash related error events covered in >> BZ 64797, which is an understandably confusing situation >> > > Would this fit better in the man page for update_flash? > > I personally don't have a preference, more just curious. > > -Nathan -- Best regards, Brad Peters IBM Linux on System-P Platform Serviceability Team Lead 15350 SW Koll Parkway 503-578-3493 TL: 775-3493 bp...@li... bp...@us... AIM: bradpeters1000 |
From: Nathan F. <nf...@au...> - 2010-06-21 20:02:09
|
On 06/18/2010 01:15 PM, Brad Peters wrote: > Adding some of description of the update_flash related error events covered in > BZ 64797, which is an understandably confusing situation > Would this fit better in the man page for update_flash? I personally don't have a preference, more just curious. -Nathan |
From: Aníbal C. A. de C. <ani...@gm...> - 2010-06-18 19:54:02
|
The issue described in 2) is not corrected by that link. The link describes, as the title says, how to reset the managed system to a nonpartitioned configuration. In BZ 64797 we had no HMC attached but still a partitioned system. Even having one logical partition with all hardware available to it does not configure a proper standalone system. 2010/6/18 Brad Peters <bp...@li...> > Adding some of description of the update_flash related error events covered > in > BZ 64797, which is an understandably confusing situation > > Signed-off by: Brad Peters > > -- > Best regards, > > Brad Peters > > IBM > Linux on System-P Platform Serviceability Team Lead > > 15350 SW Koll Parkway > 503-578-3493 > TL: 775-3493 > > bp...@li... > bp...@us... > AIM: bradpeters1000 > > > > ------------------------------------- > > > > > diff -uNrp powerpc-utils.orig/README powerpc-utils/README > --- powerpc-utils.orig/README 2010-06-18 11:06:43.000000000 -0700 > +++ powerpc-utils/README 2010-06-18 11:10:20.000000000 -0700 > @@ -16,6 +16,23 @@ update_flash: system firmware update ut > ------------ > A script that uses the rtas_flash kernel module to flash firmware. > > +Note that various conditions can lead to a firmware update failure. If > you > +receive an authentication-related error, such as: > + > +update_flash: RTAS: validate() Partition does not have authority > + > +This can reflect either > +1) That the permission is not set (correctable through the ASM interface, > +System Configuration -> Firmware Update Policy, or through an HMC if > +attached). > + > +Or > + > +2) Firmware still believes an HMC is attached. This can be corrected by > +following the steps outlined here: > + > + > http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/iphat/iphblresetserverp6.htm > + > usysident: identification indicator utility > --------- > A utility to view the status of device identification indicators > > > > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > > |
From: Brad P. <bp...@li...> - 2010-06-18 18:15:33
|
Adding some of description of the update_flash related error events covered in BZ 64797, which is an understandably confusing situation Signed-off by: Brad Peters -- Best regards, Brad Peters IBM Linux on System-P Platform Serviceability Team Lead 15350 SW Koll Parkway 503-578-3493 TL: 775-3493 bp...@li... bp...@us... AIM: bradpeters1000 ------------------------------------- diff -uNrp powerpc-utils.orig/README powerpc-utils/README --- powerpc-utils.orig/README 2010-06-18 11:06:43.000000000 -0700 +++ powerpc-utils/README 2010-06-18 11:10:20.000000000 -0700 @@ -16,6 +16,23 @@ update_flash: system firmware update ut ------------ A script that uses the rtas_flash kernel module to flash firmware. +Note that various conditions can lead to a firmware update failure. If you +receive an authentication-related error, such as: + +update_flash: RTAS: validate() Partition does not have authority + +This can reflect either +1) That the permission is not set (correctable through the ASM interface, +System Configuration -> Firmware Update Policy, or through an HMC if +attached). + +Or + +2) Firmware still believes an HMC is attached. This can be corrected by +following the steps outlined here: + +http://publib.boulder.ibm.com/infocenter/powersys/v3r1m5/index.jsp?topic=/iphat/iphblresetserverp6.htm + usysident: identification indicator utility --------- A utility to view the status of device identification indicators |
From: Nathan F. <nf...@au...> - 2010-06-11 15:35:15
|
This patch corrects the parameter handling of ppc64_cpu when setting the run-mode. The PAPR specifies that the rtas_[get|set]_system_parameter calls take a char buffer, but for the run mode it actually wants integer values in the buffer, not strings. This updates the handling of the values to be integers. This patch also add an additional error message to indicate failure when a partition is not authorized to set the run mode. Signed-off-by:Nathan Fontenot <nf...@au...> --- Index: powerpc-utils-1.2.2/src/ppc64_cpu.c =================================================================== --- powerpc-utils-1.2.2.orig/src/ppc64_cpu.c 2010-06-10 13:22:02.000000000 -0500 +++ powerpc-utils-1.2.2/src/ppc64_cpu.c 2010-06-10 13:33:09.810455522 -0500 @@ -416,11 +416,11 @@ printf("Could not retrieve current diagnostics " "mode\n"); } else - printf("run-mode=%c\n", mode[2]); + printf("run-mode=%d\n", mode[2]); } else { - signed char rmode = *run_mode; + short rmode = atoi(run_mode); - if (rmode < '0' || rmode > '3') { + if (rmode < 0 || rmode > 3) { printf("Invalid run-mode=%c\n", rmode); return -1; } @@ -433,6 +433,9 @@ if (rc == -3) printf("Machine does not support diagnostic " "run mode\n"); + else if (rc == -9002) + printf("Machine is not authorized to set " + "diagnostic run mode\n"); else printf("Could not set diagnostics mode\n"); } |
From: Brian K. <br...@li...> - 2010-05-19 20:23:23
|
Adds support for partition hibernation Signed-off-by: Brian King <br...@li...> --- src/drmgr/common.c | 13 +++- src/drmgr/dr.h | 3 + src/drmgr/drmgr.c | 16 +++++ src/drmgr/drmig_chrp_pmig.c | 124 +++++++++++++++++++++++++++++++++++++------- 4 files changed, 134 insertions(+), 22 deletions(-) diff -puN src/drmgr/common.c~hibernation src/drmgr/common.c --- powerpc-utils/src/drmgr/common.c~hibernation 2010-05-19 15:22:26.000000000 -0500 +++ powerpc-utils-bjking1/src/drmgr/common.c 2010-05-19 15:22:26.000000000 -0500 @@ -1118,6 +1118,12 @@ pmig_capable(void) } int +phib_capable(void) +{ + return dlpar_capable("partition hibernation", "/sys/devices/system/power/hibernate"); +} + +int slb_resize_capable(void) { unsigned long value; @@ -1166,7 +1172,7 @@ void print_dlpar_capabilities(void) { int cpu_dlpar, mem_dlpar, slot_dlpar, phb_dlpar, hea_dlpar; - int pmig, slb_resize; + int pmig, phib, slb_resize; int cpu_entitled, mem_entitled; cpu_dlpar = cpu_dlpar_capable(); @@ -1176,6 +1182,7 @@ print_dlpar_capabilities(void) hea_dlpar = hea_dlpar_capable(); pmig = pmig_capable(); + phib = phib_capable(); slb_resize = slb_resize_capable(); cpu_entitled = cpu_entitlement_capable(); @@ -1183,10 +1190,10 @@ print_dlpar_capabilities(void) printf("cpu_dlpar=%s,mem_dlpar=%s,slot_dlpar=%s,phb_dlpar=%s," "hea_dlpar=%s,pmig=%s,cpu_entitlement=%s,mem_entitlement=%s," - "slb_resize=%s\n", + "slb_resize=%s,phib=%s\n", (cpu_dlpar ? "yes" : "no"), (mem_dlpar ? "yes" : "no"), (slot_dlpar ? "yes" : "no"), (phb_dlpar ? "yes" : "no"), (hea_dlpar ? "yes" : "no"), (pmig ? "yes" : "no"), (cpu_entitled ? "yes" : "no"), (mem_entitled ? "yes" : "no"), - (slb_resize ? "yes" : "no")); + (slb_resize ? "yes" : "no"), (phib ? "yes" : "no")); } diff -puN src/drmgr/dr.h~hibernation src/drmgr/dr.h --- powerpc-utils/src/drmgr/dr.h~hibernation 2010-05-19 15:22:26.000000000 -0500 +++ powerpc-utils-bjking1/src/drmgr/dr.h 2010-05-19 15:22:26.000000000 -0500 @@ -101,6 +101,7 @@ struct options { #define REPLACE 4 #define IDENTIFY 5 #define MIGRATE 6 +#define HIBERNATE 7 int no_ident; /* used in drslot_chrp_pci */ int timeout; /* used in remove operation only. Default @@ -141,6 +142,7 @@ int mem_dlpar_capable(void); int slot_dlpar_capable(void); int phb_dlpar_capable(void); int pmig_capable(void); +int phib_capable(void); int hea_dlpar_capable(void); int cpu_entitlement_capable(void); int mem_entitlement_capable(void); @@ -177,5 +179,6 @@ void hea_usage(char **); int drmig_chrp_pmig(struct options *); int valid_pmig_options(struct options *); void pmig_usage(char **); +void phib_usage(char **); #endif diff -puN src/drmgr/drmig_chrp_pmig.c~hibernation src/drmgr/drmig_chrp_pmig.c --- powerpc-utils/src/drmgr/drmig_chrp_pmig.c~hibernation 2010-05-19 15:22:26.000000000 -0500 +++ powerpc-utils-bjking1/src/drmgr/drmig_chrp_pmig.c 2010-05-19 15:22:26.000000000 -0500 @@ -30,9 +30,12 @@ struct pmap_struct { char *name; }; -static struct pmap_struct *plist; +#define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/hibernate" -static char *usagestr = "-m -p {check | pre} -s <stream_id>"; +static struct pmap_struct *plist; +static int action = 0; +static char *pmig_usagestr = "-m -p {check | pre} -s <stream_id>"; +static char *phib_usagestr = "-m -p {check | pre} -s <stream_id> -n <self-arp secs>"; /** * pmig_usage @@ -41,8 +44,19 @@ static char *usagestr = "-m -p {check | void pmig_usage(char **pusage) { - *pusage = usagestr; + *pusage = pmig_usagestr; } + +/** + * phib_usage + * + */ +void +phib_usage(char **pusage) +{ + *pusage = phib_usagestr; +} + /** * add_phandle * @@ -502,12 +516,21 @@ servicelog_update(char *sys_src) event.time_event = time(NULL); event.severity = SL_SEV_INFO; - snprintf(refcode, 9, "#MIGRATE"); + if (action == MIGRATE) + snprintf(refcode, 9, "#MIGRATE"); + else /* hibernation */ + snprintf(refcode, 12, "#HIBERNATION"); event.refcode = refcode; get_str_attribute(OFDT_BASE, "system-id", sys_dest, 20); - snprintf(msg, 128, "Partition migration completed. Source: %s " - "Destination: %s", sys_src, sys_dest); /* 56 */ + + if (action == MIGRATE) + snprintf(msg, 128, "Partition migration completed. Source: " + "%s Destination: %s", sys_src, sys_dest); + else /* hibernation */ + snprintf(msg, 128, "Partition hibernation completed. Source: " + "%s Destination: %s", sys_src, sys_dest); + event.description = msg; rc = servicelog_open(&slog, 0); @@ -530,18 +553,79 @@ servicelog_update(char *sys_src) int valid_pmig_options(struct options *opts) { - if (opts->action != MIGRATE) { - err_msg("The only valid action is -m\n"); + if (opts->p_option == NULL) { + err_msg("A command must be specified\n"); return -1; } - if (opts->p_option == NULL) { - err_msg("A command must be specified\n"); + /* Determine if this is a migration or a hibernation request */ + if (!strcmp(opts->ctype, "pmig")) { + if (opts->action != MIGRATE) { + /* The -m option must be specified with migrations */ + err_msg("The -m must be specified for migrations\n"); + return -1; + } + + if (!pmig_capable()) { + err_msg("Partition Mobility is not supported.\n"); + return -1; + } + + action = MIGRATE; + } else if (!strcmp(opts->ctype, "phib")) { + if (!phib_capable()) { + err_msg("Partition Hibernation is not supported.\n"); + return -1; + } + + action = HIBERNATE; + } else { + err_msg("The value \"%s\" for the -c option is not valid\n", + opts->ctype); return -1; } return 0; } + +int do_migration(uint64_t stream_val) +{ + int rc; + + dbg("about to issue ibm,suspend-me(%llx)\n", stream_val); + rc = rtas_suspend_me(stream_val); + dbg("ibm,suspend-me() returned %d\n", rc); + return rc; +} + +int do_hibernation(uint64_t stream_val) +{ + int rc, fd; + char buf[64]; + + sprintf(buf, "0x%llx\n", stream_val); + + fd = open(SYSFS_HIBERNATION_FILE, O_WRONLY); + if (fd == -1) { + err_msg("Could not open \"%s\" to initiate hibernation, %m\n", + SYSFS_HIBERNATION_FILE); + return -1; + } + + dbg("Initiating hibernation via %s with %s\n", + SYSFS_HIBERNATION_FILE, buf); + + rc = write(fd, buf, strlen(buf)); + if (rc < 0) { + dbg("Write to hibernation file failed with rc: %d\n", rc); + rc = errno; + } else if (rc > 0) + rc = 0; + close(fd); + dbg("Kernel hibernation returned %d\n", rc); + + return rc; +} int drmig_chrp_pmig(struct options *opts) @@ -588,22 +672,24 @@ drmig_chrp_pmig(struct options *opts) /* Get the ID of the original system, for later logging */ get_str_attribute(OFDT_BASE, "system-id", sys_src, 20); + sleep(5); /* Now do the actual migration */ do { - dbg("about to issue ibm,suspend-me(%llx)\n", stream_val); - - rc = rtas_suspend_me(stream_val); - if (rc == NOT_SUSPENDABLE) { - dbg("rtas_suspend_me() returned NOT_SUSPENDABLE, " - "sleeping...\n"); + if (action == MIGRATE) + rc = do_migration(stream_val); + else if (action == HIBERNATE) + rc = do_hibernation(stream_val); + else + rc = -EINVAL; + + if (rc == NOT_SUSPENDABLE) sleep(1); - } else - dbg("ibm,suspend-me() returned %d\n", rc); } while (rc == NOT_SUSPENDABLE); - syslog(LOG_LOCAL0 | LOG_INFO, "drmgr: ibm,suspend-me rc %d\n", rc); + syslog(LOG_LOCAL0 | LOG_INFO, "drmgr: %s rc %d\n", + (action == MIGRATE ? "migration" : "hibernation"), rc); if (rc) return rc; diff -puN src/drmgr/drmgr.c~hibernation src/drmgr/drmgr.c --- powerpc-utils/src/drmgr/drmgr.c~hibernation 2010-05-19 15:22:26.000000000 -0500 +++ powerpc-utils-bjking1/src/drmgr/drmgr.c 2010-05-19 15:22:26.000000000 -0500 @@ -50,6 +50,7 @@ struct command { #define DRSLOT_CHRP_HEA 5 #define DRSLOT_CHRP_CPU 6 #define DRMIG_CHRP_PMIG 7 +#define DRSLOT_CHRP_PHIB 8 static struct command commands[] = { { .type = DRMGR, @@ -100,6 +101,12 @@ static struct command commands[] = { .validate_options = valid_pmig_options, .usage = pmig_usage, }, + { .type = DRSLOT_CHRP_PHIB, + .name = "drslot_chrp_phib", + .func = drmig_chrp_pmig, + .validate_options = valid_pmig_options, + .usage = phib_usage, + }, }; static struct option long_options[] = { @@ -236,6 +243,10 @@ parse_options(int argc, char *argv[], st action_cnt++; break; case 'n': + /* The -n option is also used to specify a number of + * seconds to attempt a self-arp. Linux ignores this + * for hibernation. + */ opts->noprompt = 1; break; case 'p': @@ -315,6 +326,11 @@ get_command(struct options *opts) if (! strcmp(opts->ctype, "cpu")) return &commands[DRSLOT_CHRP_CPU]; + + if (! strcmp(opts->ctype, "phib")) { + opts->action = HIBERNATE; + return &commands[DRSLOT_CHRP_PHIB]; + } /* If we make it this far, the user specified an invalid * connector type. _ |
From: Nathan F. <nf...@au...> - 2010-05-19 14:34:50
|
This patch removes the redundant code for getting the online status of a cpu thread in the get_one_smt_state() routine and now uses the common cpu_online() routine. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/ppc64_cpu.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2010-05-19 08:22:42.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2010-05-19 08:25:31.000000000 -0500 @@ -197,22 +197,12 @@ int get_one_smt_state(int primary_thread) { - struct stat sb; - char online_file[SYSFS_PATH_MAX]; int thread_state; int smt_state = 0; - int i, rc; + int i; for (i = 0; i < threads_per_cpu; i++) { - sprintf(online_file, SYSFS_CPUDIR"/%s", primary_thread + i, - "online"); - if (stat(online_file, &sb)) - return -1; - - rc = get_attribute(online_file, &thread_state); - if (rc) - return -1; - + thread_state = cpu_online(primary_thread + i); smt_state += thread_state; } |
From: Nathan F. <nf...@au...> - 2010-05-19 14:32:53
|
The sysfs file used to update the dscr setting expects that the value written to it is in hex. The ppc64_cpu command does not adhere to this, it currently writes the value in decimal, which leads to incorrect settings. This patch corrects this by creating new common read/write routines that take a format string so we can control how a value is written to sysfs. This also allows us to maintain an interface where users can specify the value to be written in any format and still correctly write the value to sysfs. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/ppc64_cpu.c | 79 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 29 deletions(-) Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2010-05-18 12:04:05.000000000 -0500 +++ powerpc-utils/src/ppc64_cpu.c 2010-05-19 08:22:42.000000000 -0500 @@ -26,7 +26,7 @@ int cpus_in_system = 0; int threads_in_system = 0; -int get_attribute(char *path, int *value) +int get_attribute(char *path, const char *fmt, int *value) { FILE *fp; @@ -34,13 +34,13 @@ if (fp == NULL) return -1; - fscanf(fp, "%i", value); + fscanf(fp, fmt, value); fclose(fp); return 0; } -int set_attribute(char *path, int value) +int set_attribute(const char *path, const char *fmt, int value) { FILE *fp; @@ -48,7 +48,7 @@ if (fp == NULL) return -1; - fprintf(fp, "%d", value); + fprintf(fp, fmt, value); fclose(fp); return 0; @@ -60,14 +60,14 @@ int rc, online; sprintf(path, SYSFS_CPUDIR"/online", thread); - rc = get_attribute(path, &online); + rc = get_attribute(path, "%d", &online); if (rc || !online) return 0; return 1; } -int get_system_attribute(char *attribute, int *value) +int get_system_attribute(char *attribute, const char *fmt, int *value) { char path[SYSFS_PATH_MAX]; int i, rc; @@ -81,7 +81,7 @@ continue; sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); - rc = get_attribute(path, &cpu_attribute); + rc = get_attribute(path, fmt, &cpu_attribute); if (rc) continue; @@ -95,7 +95,7 @@ return 0; } -int set_system_attribute(char *attribute, int state) +int set_system_attribute(char *attribute, const char *fmt, int state) { char path[SYSFS_PATH_MAX]; int i, rc; @@ -106,7 +106,7 @@ continue; sprintf(path, SYSFS_CPUDIR"/%s", i, attribute); - rc = set_attribute(path, state); + rc = set_attribute(path, fmt, state); if (rc) return -1; } @@ -114,6 +114,37 @@ return 0; } +int set_dscr(int state) +{ + return set_system_attribute("dscr", "%x", state); +} + +int get_dscr(int *value) +{ + return get_system_attribute("dscr", "%x", value); +} + +int set_smt_snooze_delay(int delay) +{ + return set_system_attribute("smt_snooze_delay", "%d", delay); +} + +int get_smt_snooze_delay(int *delay) +{ + return get_system_attribute("smt_snooze_delay", "%d", delay); +} + +int online_thread(const char *path) +{ + return set_attribute(path, "%d", 1); +} + +int offline_thread(const char *path) +{ + return set_attribute(path, "%d", 0); +} + + int get_cpu_info(void) { DIR *d; @@ -217,7 +248,7 @@ for (i = 0; i < online_threads; i++) { snprintf(path, SYSFS_PATH_MAX, SYSFS_CPUDIR"/%s", thread + i, "online"); - rc = set_attribute(path, 1); + rc = online_thread(path); if (rc) return rc; } @@ -225,7 +256,7 @@ for (; i < threads_per_cpu; i++) { snprintf(path, SYSFS_PATH_MAX, SYSFS_CPUDIR"/%s", thread + i, "online"); - rc = set_attribute(path, 0); + rc = offline_thread(path); if (rc) break; } @@ -238,7 +269,7 @@ int i, rc; int ssd, update_ssd = 1; - rc = get_system_attribute("smt_snooze_delay", &ssd); + rc = get_smt_snooze_delay(&ssd); if (rc) update_ssd = 0; @@ -249,7 +280,7 @@ } if (update_ssd) - set_system_attribute("smt_snooze_delay", ssd); + set_smt_snooze_delay(ssd); return rc; } @@ -321,7 +352,7 @@ if (!state) { int dscr; - rc = get_system_attribute("dscr", &dscr); + rc = get_dscr(&dscr); if (rc) { printf("Could not retrieve DSCR\n"); } else { @@ -331,7 +362,7 @@ printf("dscr is %d\n", dscr); } } else - rc = set_system_attribute("dscr", strtol(state, NULL, 0)); + rc = set_dscr(strtol(state, NULL, 0)); return rc; } @@ -347,7 +378,7 @@ if (!state) { int ssd; - rc = get_system_attribute("smt_snooze_delay", &ssd); + rc = get_smt_snooze_delay(&ssd); if (rc) { printf("Could not retrieve smt_snooze_delay\n"); } else { @@ -364,7 +395,7 @@ else delay = strtol(state, NULL, 0); - rc = set_system_attribute("smt_snooze_delay", delay); + rc = set_smt_snooze_delay(delay); } return rc; |
From: Nathan F. <nf...@au...> - 2010-05-18 17:13:00
|
The ofpathname script uses the soon to be deprecated udevinfo command. This patch updates the ofpthname script to use the new udevadm command if present. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/scripts/ofpathname =================================================================== --- powerpc-utils.orig/scripts/ofpathname 2010-05-18 08:15:43.000000000 -0500 +++ powerpc-utils/scripts/ofpathname 2010-05-18 08:28:47.000000000 -0500 @@ -232,12 +232,23 @@ { local this_dir=$PWD local sysfs_dir + local udev_path local udevinfo="/usr/bin/udevinfo" + local udevadm="/sbin/udevadm" - if [[ ! -a $udevinfo ]]; then + if [[ -a $udevadm ]]; then + udev_path=`$udevadm info --query=path --name=$DEVNAME` + elif [[ -a $udevinfo ]]; then + udev_path=`$udevinfo -q path -n $DEVNAME` + else + echo "no" + return + fi + + if [[ -z $udev_path ]]; then echo "no" else - sysfs_dir=`get_link -f /sys/$($udevinfo -q path -n $DEVNAME)/device` + sysfs_dir=`get_link -f /sys/$udev_path/device` if [[ ! -d $sysfs_dir ]]; then echo "no" else |
From: Nathan F. <nf...@au...> - 2010-05-18 17:11:01
|
This patch corrects the parsing of sysfs when looking for the open firmware device name for an ethernet device. The error occurs when multiple sysfs entries (i.e. links) point to the ethernet device we are looking for. The patch checks results until we get a path. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/scripts/ofpathname =================================================================== --- powerpc-utils.orig/scripts/ofpathname 2010-05-05 08:57:48.000000000 -0500 +++ powerpc-utils/scripts/ofpathname 2010-05-18 08:15:43.000000000 -0500 @@ -386,14 +386,15 @@ # l2of_ethernet() { - local sysfs_eth=`$FIND /sys -name $DEVICE 2> /dev/null` - if [[ -z $sysfs_eth ]]; then - err $ERR_NOT_CONFIG - fi + for syspath in `$FIND /sys -name $DEVICE 2> /dev/null`; do + if [[ -e $syspath/device/devspec ]]; then + OF_PATH=`$CAT $syspath/device/devspec` + break + fi + done - OF_PATH=`$CAT $sysfs_eth/device/devspec` if [[ -z $OF_PATH ]]; then - err $ERR_NO_OFPATH + err $ERR_NO_OFPATH fi } |
From: Nathan F. <nf...@au...> - 2010-05-18 17:03:53
|
This patch corrects the handling of the -v option for the nvram command. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils-1.2.2/src/nvram.c =================================================================== --- powerpc-utils-1.2.2.orig/src/nvram.c 2009-10-22 14:00:13.000000000 -0500 +++ powerpc-utils-1.2.2/src/nvram.c 2010-05-17 03:05:47.167273891 -0500 @@ -1490,7 +1490,7 @@ for (;;) { option_index = 0; - ret = getopt_long(argc, argv, "+v:p:", long_options, &option_index); + ret = getopt_long(argc, argv, "+p:v", long_options, &option_index); if (ret == -1) break; switch (ret) { |
From: Nathan F. <nf...@au...> - 2010-05-18 16:24:26
|
This patch corrects the parameter checking when attempting to set the run mode. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils-1.2.2/src/ppc64_cpu.c =================================================================== --- powerpc-utils-1.2.2.orig/src/ppc64_cpu.c 2009-10-22 14:00:13.000000000 -0500 +++ powerpc-utils-1.2.2/src/ppc64_cpu.c 2010-05-17 14:29:45.577267014 -0500 @@ -383,7 +383,7 @@ } else { signed char rmode = *run_mode; - if (rmode < 0 || rmode > 3) { + if (rmode < '0' || rmode > '3') { printf("Invalid run-mode=%c\n", rmode); return -1; } |
From: Antonio R. <ros...@au...> - 2010-04-18 21:52:23
|
During recent testing we found the "-v" option to nvram was returning a usage error message: # /usr/sbin/nvram -v /usr/sbin/nvram: option requires an argument -- 'v' Looking at: powerpc-utils-1.2.3/src/nvram.c 1494 ret = getopt_long(argc, argv, "+v:p:", long_options, &option_index); The opstring argument to getopt_long() has "v:" indicating an additional parameter is needed when "-v" is given. Removing the ":" following "v" in the opstring argument to getopt_long() returns the expected output for "-v" "--v" and "--verbose." # ./patch/powerpc-utils-1.2.3/src/nvram -v NVRAM size 8192 bytes NVRAM contains 6 partitions # ./patch/powerpc-utils-1.2.3/src/nvram --v NVRAM size 8192 bytes NVRAM contains 6 partitions # ./patch/powerpc-utils-1.2.3/src/nvram --verbose NVRAM size 8192 bytes NVRAM contains 6 partitions # Please review the attached patched to powerpc-utils-1.2.3/src/nvram.c, and let me know what your thoughts are regarding the patch. |
From: Nathan F. <nf...@au...> - 2010-04-15 16:08:12
|
Updated patch to look in /proc/ppc64/lparcfg instead of /proc/powerpc/lparcfg so this new code will with older kernels. The amsstat appears to make some assumptions, namely that AMS is enabled and all of the files it pulls data from exist. This patch updates the script to verify that AMS is available and enabled before trying to gather information. If either are not, it prints an error message and exits. This also updates the file checking to redirect error messages from the pushd command and print an appropriate error message if the file is not present. Signed-off-by: Nathan Fontenot <nf...@au...> --- scripts/amsstat | 64 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 14 deletions(-) Index: powerpc-utils/scripts/amsstat =================================================================== --- powerpc-utils.orig/scripts/amsstat 2010-01-22 14:21:23.000000000 -0600 +++ powerpc-utils/scripts/amsstat 2010-04-15 09:42:27.000000000 -0500 @@ -22,6 +22,7 @@ indent=-4 devstat_data_spacing=-30 lparcfg_data_spacing=-30 +lparcfg_file=/proc/ppc64/lparcfg function print_meminfo_stats { echo "System Memory Statistics:" @@ -38,7 +39,7 @@ done # Include Desired Memory value from /proc/ppc64/lparcfg - stat=`grep "^DesMem" /proc/ppc64/lparcfg` + stat=`grep "^DesMem" $lparcfg_file` if [ ! -z "${stat}" ]; then this_stat=`echo $stat | awk -F= '{print $1}'` this_value=`echo $stat | awk -F= '{print $2}'` @@ -48,7 +49,7 @@ function print_entitlement_data { echo "Entitlement Information:" - for stat in `cat /proc/ppc64/lparcfg`; do + for stat in `cat $lparcfg_file`; do if echo $stat | grep "^entitled_memory\|^mapped_entitled_memory\|^entitled_memory_weight\|entitled_memory_pool_size\|^backing_memory\|^cmo_enabled\|^cmo_faults\|^cmo_fault_time_usec\|cmo_primary_psp\|^cmo_secondary_psp" >/dev/null; then this_stat=`echo $stat | awk -F= '{print $1}'` this_value=`echo $stat | awk -F= '{print $2}'` @@ -59,12 +60,15 @@ function print_cmm_stats { # CMM kernel parameters + echo "CMM Statistics:" + local path=/sys/module/cmm/parameters - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get CMM Statistics.\n" " " + return fi - echo "CMM Statistics:" + for stat in `find . -mindepth 1 -maxdepth 1 -print`; do printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done @@ -72,9 +76,9 @@ # CMM statistics local path=/sys/devices/system/cmm/cmm0 - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + return fi for stat in `find . -mindepth 1 -maxdepth 1 -print`; do printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" @@ -83,33 +87,50 @@ } function print_vio_bus_stats { + echo "VIO Bus Statistics:" + local found=0 local path=/sys/bus/vio - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get VIO Bus Statistics.\n" " " + return fi - echo "VIO Bus Statistics:" + for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do + found=1 printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done popd >/dev/null + + if [ "$found" -eq "0" ]; then + printf "%${indent}s No AMS Busses found.\n" " " + fi } function print_vio_dev_stats { + echo "VIO Device Statistics:" + + local found=0 local path=/sys/bus/vio/devices - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get VIO Device Statistics.\n" " " + return fi - echo "VIO Device Statistics:" + for dir in `find . -mindepth 1 -print`; do - pushd $dir >/dev/null + pushd $dir >/dev/null 2>&1 if [ $? -ne 0 ] ; then break fi # Skip printing devices that are not using entitlement + if [ ! -e "cmo_entitled" ]; then + popd >/dev/null + continue + fi + value=`cat cmo_entitled` if [ ${value} -eq "0" ]; then popd >/dev/null @@ -119,13 +140,28 @@ NAME=$(cat devspec) echo " ${NAME##/*/}:" for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do + found=1 printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done popd >/dev/null done popd >/dev/null + + if [ "$found" -eq "0" ]; then + printf "%${indent}s No AMS devices found.\n" " " + fi } +# Verify CMO is present and enabled +enabled=`cat $lparcfg_file | grep "^cmo_enabled" | awk -F= '{print $2}'` +if [ -z $enabled ]; then + echo "This system is not capable of Active Memory Sharing." + exit -1 +elif [ "$enabled" -eq "0" ]; then + echo "Active Memory Sharing is not enabled on this system." + exit -1 +fi + if [ -z $sleep_interval ]; then date print_meminfo_stats |
From: Nathan F. <nf...@au...> - 2010-04-14 15:01:21
|
The amsstat appears to make some assumptions, namely that AMS is enabled and all of the files it pulls data from exist. This patch updates the script to verify that AMS is available and enabled before trying to gather information. If either are not, it prints an error message and exits. This also updates the file checking to redirect error messages from the pushd command and print an appropriate error message if the file is not present. Signed-off-by: Nathan Fontenot <nf...@au...> --- scripts/amsstat | 59 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 12 deletions(-) Index: powerpc-utils/scripts/amsstat =================================================================== --- powerpc-utils.orig/scripts/amsstat 2010-01-22 14:21:23.000000000 -0600 +++ powerpc-utils/scripts/amsstat 2010-04-14 09:31:27.000000000 -0500 @@ -59,12 +59,15 @@ function print_cmm_stats { # CMM kernel parameters + echo "CMM Statistics:" + local path=/sys/module/cmm/parameters - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get CMM Statistics.\n" " " + return fi - echo "CMM Statistics:" + for stat in `find . -mindepth 1 -maxdepth 1 -print`; do printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done @@ -72,9 +75,9 @@ # CMM statistics local path=/sys/devices/system/cmm/cmm0 - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + return fi for stat in `find . -mindepth 1 -maxdepth 1 -print`; do printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" @@ -83,33 +86,50 @@ } function print_vio_bus_stats { + echo "VIO Bus Statistics:" + local found=0 local path=/sys/bus/vio - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get VIO Bus Statistics.\n" " " + return fi - echo "VIO Bus Statistics:" + for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do + found=1 printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done popd >/dev/null + + if [ "$found" -eq "0" ]; then + printf "%${indent}s No AMS Busses found.\n" " " + fi } function print_vio_dev_stats { + echo "VIO Device Statistics:" + + local found=0 local path=/sys/bus/vio/devices - pushd $path >/dev/null + pushd $path >/dev/null 2>&1 if [ $? -ne 0 ] ; then - exit 1 + printf "%${indent}s Could not get VIO Device Statistics.\n" " " + return fi - echo "VIO Device Statistics:" + for dir in `find . -mindepth 1 -print`; do - pushd $dir >/dev/null + pushd $dir >/dev/null 2>&1 if [ $? -ne 0 ] ; then break fi # Skip printing devices that are not using entitlement + if [ ! -e "cmo_entitled" ]; then + popd >/dev/null + continue + fi + value=`cat cmo_entitled` if [ ${value} -eq "0" ]; then popd >/dev/null @@ -119,13 +139,28 @@ NAME=$(cat devspec) echo " ${NAME##/*/}:" for stat in `find . -mindepth 1 -maxdepth 1 -name "cmo*" -print`; do + found=1 printf "%${indent}s %${devstat_data_spacing}s %${devstat_data_spacing}s\n" " " "${stat#\.\/}:" "`cat $stat`" done popd >/dev/null done popd >/dev/null + + if [ "$found" -eq "0" ]; then + printf "%${indent}s No AMS devices found.\n" " " + fi } +# Verify CMO is present and enabled +enabled=`cat /proc/powerpc/lparcfg | grep "^cmo_enabled" | awk -F= '{print $2}'` +if [ -z $enabled ]; then + echo "This system is not capable of Active Memory Sharing." + exit -1 +elif [ "$enabled" -eq "0" ]; then + echo "Active Memory Sharing is not enabled on this system." + exit -1 +fi + if [ -z $sleep_interval ]; then date print_meminfo_stats |
From: Kamalesh B. <kam...@li...> - 2010-03-31 04:46:18
|
Hi, This patch adds -a -V options to the ofpathname man page Signed-off-by: Kamalesh Babulal <kam...@li...> -- man/ofpathname.8 | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/man/ofpathname.8 b/man/ofpathname.8 index 1f61b88..e164013 100644 --- a/man/ofpathname.8 +++ b/man/ofpathname.8 @@ -6,7 +6,7 @@ .SH NAME ofpathname \- translate between Open Firmware and logical device names .SH SYNOPSIS -\fB/usr/sbin/ofpathname \fR[\fB-lq\fR] \fIname +\fB/usr/sbin/ofpathname \fR[\fB-laqVh\fR] \fIname .SH DESCRIPTION .I Ofpathname provides the ability to translate logical device names to their Open Firmware @@ -17,14 +17,19 @@ Firmware device path to its logical device name using the -l option. \fB\-l Translate the \fIname \fRparameter to the corresponding logical device name. .TP +\fB\-a +Find matching Open Firmware device alias[es]. +.TP \fB\--quiet \fR(\fB\-q\fR) Do not report any failures, exit quietly. .TP -\fB\--help \fR(\fB\-?\fR) +\fB\--version \fR(\fB\-V\fR) +Display version information and exit. +.TP +\fB\--help \fR(\fB\-h\fR) print usage information. .SH AUTHOR Written by Nathan Fontenot .SH "SEE ALSO" .BR bootlist (8), .BR nvram (8) - Kamalesh |
From: Brian K. <br...@li...> - 2010-03-22 14:24:05
|
Fixes an issue on some kernel versions generating the ofpathname for FC LUNs attached to lpfc based adapters. Signed-off-by: Brian King <br...@li...> --- scripts/ofpathname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN scripts/ofpathname~ofpathname_lpfc_fix scripts/ofpathname --- powerpc-utils/scripts/ofpathname~ofpathname_lpfc_fix 2010-03-22 09:10:33.000000000 -0500 +++ powerpc-utils-bjking1/scripts/ofpathname 2010-03-22 09:11:31.000000000 -0500 @@ -490,7 +490,7 @@ l2of_scsi() fc=${fc##/*/} if [[ $fc = "fibre-channel" ]]; then local fc_lun=`get_fc_scsilun $LUN` - local wwpn=`get_fc_wwpn "$device_path/../../fc_remote_ports"` + local wwpn=`get_fc_wwpn "$device_path/../../fc_remote_ports*"` OF_PATH=$(printf "%s/disk@%s,%s" $OF_PATH $wwpn $fc_lun) elif [[ $vdev = "/vdevice" ]]; then # get the v-device data _ |
From: Kamalesh B. <kam...@li...> - 2010-03-22 12:15:58
|
Hi, This patch fixes the typo in man ofpathname.8, Signed-off-by: Kamalesh Babulal <kam...@li...> -- man/ofpathname.8 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/man/ofpathname.8 b/man/ofpathname.8 index 1f61b88..ae9a16a 100644 --- a/man/ofpathname.8 +++ b/man/ofpathname.8 @@ -10,7 +10,7 @@ ofpathname \- translate between Open Firmware and logical device names .SH DESCRIPTION .I Ofpathname provides the ability to translate logical device names to their Open Firmware -device path names for PoowerPC-64 systems. It can also translate an Open +device path names for PowerPC-64 systems. It can also translate an Open Firmware device path to its logical device name using the -l option. .SH OPTIONS .TP Kamalesh |
From: Nathan F. <nf...@au...> - 2010-03-04 20:40:06
|
Add functionality for HMC initiated partition hibernation. The kernel support for HMC initiated hibernation was recently submitted upstream, and these drmgr updates are needed top recognize hibernation requests from the HMC and invoke hibernation on the partition. Signed-off-by: Nathan Fontenot <nf...@au...> See the following patches for kernel support: http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-February/080555.html http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-February/080556.html This patch should probably not be committed until the kernel patches are accepted upstream. --- src/drmgr/common.c | 13 +++ src/drmgr/dr.h | 4 + src/drmgr/drmgr.c | 18 +++++ src/drmgr/drmig_chrp_pmig.c | 144 ++++++++++++++++++++++++++++++++++---------- 4 files changed, 143 insertions(+), 36 deletions(-) Index: ppu-ssh/src/drmgr/common.c =================================================================== --- ppu-ssh.orig/src/drmgr/common.c 2010-03-04 13:13:04.000000000 -0600 +++ ppu-ssh/src/drmgr/common.c 2010-03-04 13:14:17.000000000 -0600 @@ -1111,6 +1111,12 @@ } int +phib_capable(void) +{ + return dlpar_capable("partition hibernation", SYSFS_HIBERNATION_FILE); +} + +int slb_resize_capable(void) { unsigned long value; @@ -1159,7 +1165,7 @@ print_dlpar_capabilities(void) { int cpu_dlpar, mem_dlpar, slot_dlpar, phb_dlpar, hea_dlpar; - int pmig, slb_resize; + int pmig, phib, slb_resize; int cpu_entitled, mem_entitled; cpu_dlpar = cpu_dlpar_capable(); @@ -1169,6 +1175,7 @@ hea_dlpar = hea_dlpar_capable(); pmig = pmig_capable(); + phib = phib_capable(); slb_resize = slb_resize_capable(); cpu_entitled = cpu_entitlement_capable(); @@ -1176,10 +1183,10 @@ printf("cpu_dlpar=%s,mem_dlpar=%s,slot_dlpar=%s,phb_dlpar=%s," "hea_dlpar=%s,pmig=%s,cpu_entitlement=%s,mem_entitlement=%s," - "slb_resize=%s\n", + "slb_resize=%s,phib=%s\n", (cpu_dlpar ? "yes" : "no"), (mem_dlpar ? "yes" : "no"), (slot_dlpar ? "yes" : "no"), (phb_dlpar ? "yes" : "no"), (hea_dlpar ? "yes" : "no"), (pmig ? "yes" : "no"), (cpu_entitled ? "yes" : "no"), (mem_entitled ? "yes" : "no"), - (slb_resize ? "yes" : "no")); + (slb_resize ? "yes" : "no"), (phib ? "yes" : "no")); } Index: ppu-ssh/src/drmgr/dr.h =================================================================== --- ppu-ssh.orig/src/drmgr/dr.h 2010-01-05 12:49:07.000000000 -0600 +++ ppu-ssh/src/drmgr/dr.h 2010-03-04 13:14:17.000000000 -0600 @@ -87,6 +87,7 @@ #define OFDTPATH "/proc/ppc64/ofdt" #define DR_COMMAND "drslot_chrp_%s" #define DRMIG_COMMAND "drmig_chrp_%s" +#define SYSFS_HIBERNATION_FILE "/sys/devices/system/power/power0/hibernate" #define DR_WAIT -1 /* Wait forever */ #define DR_NOWAIT 0 /* Return immediately if lock cannot be granted */ @@ -101,6 +102,7 @@ #define REPLACE 4 #define IDENTIFY 5 #define MIGRATE 6 +#define HIBERNATE 7 int no_ident; /* used in drslot_chrp_pci */ int timeout; /* used in remove operation only. Default @@ -141,6 +143,7 @@ int slot_dlpar_capable(void); int phb_dlpar_capable(void); int pmig_capable(void); +int phib_capable(void); int hea_dlpar_capable(void); int cpu_entitlement_capable(void); int mem_entitlement_capable(void); @@ -177,5 +180,6 @@ int drmig_chrp_pmig(struct options *); int valid_pmig_options(struct options *); void pmig_usage(char **); +void phib_usage(char **); #endif Index: ppu-ssh/src/drmgr/drmig_chrp_pmig.c =================================================================== --- ppu-ssh.orig/src/drmgr/drmig_chrp_pmig.c 2010-01-05 12:49:07.000000000 -0600 +++ ppu-ssh/src/drmgr/drmig_chrp_pmig.c 2010-03-04 14:01:05.000000000 -0600 @@ -31,8 +31,10 @@ }; static struct pmap_struct *plist; +static int action = 0; -static char *usagestr = "-m -p {check | pre} -s <stream_id>"; +static char *pmig_usagestr = "-m -p {check | pre} -s <stream_id>"; +static char *phib_usagestr = "-m -p {check | pre} -s <stream_id> -n <self-arp secs>"; /** * pmig_usage @@ -41,8 +43,19 @@ void pmig_usage(char **pusage) { - *pusage = usagestr; + *pusage = pmig_usagestr; } + +/** + * pmig_usage + * + */ +void +phib_usage(char **pusage) +{ + *pusage = phib_usagestr; +} + /** * add_phandle * @@ -502,12 +515,21 @@ event.time_event = time(NULL); event.severity = SL_SEV_INFO; - snprintf(refcode, 9, "#MIGRATE"); + if (action == MIGRATE) + snprintf(refcode, 11, "#MIGRATION"); + else /* hibernation */ + snprintf(refcode, 12, "#HIBERNATION"); event.refcode = refcode; get_str_attribute(OFDT_BASE, "system-id", sys_dest, 20); - snprintf(msg, 128, "Partition migration completed. Source: %s " - "Destination: %s", sys_src, sys_dest); /* 56 */ + + if (action == MIGRATE) + snprintf(msg, 128, "Partition migration completed. Source: " + "%s Destination: %s", sys_src, sys_dest); + else /* hibernation */ + snprintf(msg, 128, "Partition hibernation completed. Source: " + "%s Destination: %s", sys_src, sys_dest); + event.description = msg; rc = servicelog_open(&slog, 0); @@ -530,19 +552,90 @@ int valid_pmig_options(struct options *opts) { - if (opts->action != MIGRATE) { - err_msg("The only valid action is -m\n"); + if (opts->p_option == NULL) { + err_msg("A command must be specified\n"); return -1; } - if (opts->p_option == NULL) { - err_msg("A command must be specified\n"); + /* Determine if this is a migration or a hibernation request */ + if (!strcmp(opts->ctype, "pmig")) { + if (opts->action != MIGRATE) { + /* The -m option must be specified with migrations */ + err_msg("The -m must be specified for migrations\n"); + return -1; + } + + if (!pmig_capable()) { + err_msg("Partition Mobility is not supported.\n"); + return -1; + } + + action = MIGRATE; + } else if (!strcmp(opts->ctype, "phib")) { + if (!phib_capable()) { + err_msg("Partition Hibernation is not supported.\n"); + return -1; + } + + action = HIBERNATE; + } else { + err_msg("The value \"%s\" for the -c option is not valid\n", + opts->ctype); return -1; } return 0; } + +int do_migration(uint64_t stream_val) +{ + int rc; + + do { + dbg("about to issue ibm,suspend-me(%llx)\n", stream_val); + rc = rtas_suspend_me(stream_val); + if (rc == NOT_SUSPENDABLE) { + dbg("rtas_suspend_me() returned NOT_SUSPENDABLE, " + "sleeping...\n"); + sleep(1); + } else + dbg("ibm,suspend-me() returned %d\n", rc); + + } while (rc == NOT_SUSPENDABLE); + + return rc; +} + +int do_hibernation(uint64_t stream_val) +{ + int rc, fd; + char buf[64]; + + sprintf(buf, "%lx", stream_val); + + fd = open(SYSFS_HIBERNATION_FILE, O_WRONLY); + if (!fd) { + err_msg("Could not open \"%s\" to initiate hibernation, %s\n", + SYSFS_HIBERNATION_FILE, strerror(errno)); + return -1; + } + + dbg("Initiating hibernation with stream id %s\n", buf); + do { + rc = write(fd, &buf, strlen(buf)); + if (rc == NOT_SUSPENDABLE) { + dbg("kernel_hibernation returned NOT_SUSPENDABLE, " + "sleeping...\n"); + sleep(1); + } else + dbg("kernel hibernation returned %d\n", rc); + } while (rc == NOT_SUSPENDABLE); + + close(fd); + return rc; +} + int drmig_chrp_pmig(struct options *opts) { @@ -551,15 +644,8 @@ char sys_src[20]; uint64_t stream_val; - /* Ensure that this partition is migratable/mobile */ - if (! pmig_capable()) { - fprintf(stderr, "drmig_chrp_pmig: Partition Mobility is not " - "supported on this kernel.\n"); - return -1; - } - - /* Today we do no pre-checks for migratability. The only check - * we could do is whether the "ibm,suspend-me" RTAS call exists. + /* Today we do no pre-checks for migration or hibernation. The only + * check we could do is whether the "ibm,suspend-me" RTAS call exists. * But if it doesn't, the firmware level doesn't support migration, * in which case why the heck are we being invoked anyways. */ @@ -589,21 +675,15 @@ /* Get the ID of the original system, for later logging */ get_str_attribute(OFDT_BASE, "system-id", sys_src, 20); - /* Now do the actual migration */ - do { - dbg("about to issue ibm,suspend-me(%llx)\n", stream_val); - - rc = rtas_suspend_me(stream_val); - if (rc == NOT_SUSPENDABLE) { - dbg("rtas_suspend_me() returned NOT_SUSPENDABLE, " - "sleeping...\n"); - sleep(1); - } else - dbg("ibm,suspend-me() returned %d\n", rc); - - } while (rc == NOT_SUSPENDABLE); + if (action == MIGRATE) + rc = do_migration(stream_val); + else if (action == HIBERNATE) + rc = do_hibernation(stream_val); + else + rc = -1; - syslog(LOG_LOCAL0 | LOG_INFO, "drmgr: ibm,suspend-me rc %d\n", rc); + syslog(LOG_LOCAL0 | LOG_INFO, "drmgr: %s rc %d\n", + (action == MIGRATE ? "migration" : "hibernation"), rc); if (rc) return rc; Index: ppu-ssh/src/drmgr/drmgr.c =================================================================== --- ppu-ssh.orig/src/drmgr/drmgr.c 2010-01-05 12:49:07.000000000 -0600 +++ ppu-ssh/src/drmgr/drmgr.c 2010-03-04 13:14:17.000000000 -0600 @@ -42,7 +42,7 @@ cmd_usage_t *usage; }; -#define DRMGR 0 +#define DRMGR 0 #define DRSLOT_CHRP_SLOT 1 #define DRSLOT_CHRP_PHB 2 #define DRSLOT_CHRP_PCI 3 @@ -50,6 +50,7 @@ #define DRSLOT_CHRP_HEA 5 #define DRSLOT_CHRP_CPU 6 #define DRMIG_CHRP_PMIG 7 +#define DRSLOT_CHRP_PHIB 8 static struct command commands[] = { { .type = DRMGR, @@ -100,6 +101,12 @@ .validate_options = valid_pmig_options, .usage = pmig_usage, }, + { .type = DRSLOT_CHRP_PHIB, + .name = "drslot_chrp_phib", + .func = drmig_chrp_pmig, + .validate_options = valid_pmig_options, + .usage = phib_usage, + }, }; static struct option long_options[] = { @@ -236,6 +243,10 @@ action_cnt++; break; case 'n': + /* The -n option is also used to specify a number of + * seconds to attempt a self-arp. Linux ignores this + * for hibernation. + */ opts->noprompt = 1; break; case 'p': @@ -315,6 +326,11 @@ if (! strcmp(opts->ctype, "cpu")) return &commands[DRSLOT_CHRP_CPU]; + + if (! strcmp(opts->ctype, "phib")) { + opts->action = HIBERNATE; + return &commands[DRSLOT_CHRP_PHIB]; + } /* If we make it this far, the user specified an invalid * connector type. |