commit powerpc-utils for openSUSE:Factory
Hello community, here is the log from the commit of package powerpc-utils for openSUSE:Factory checked in at 2014-01-24 21:42:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old) and /work/SRC/openSUSE:Factory/.powerpc-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "powerpc-utils" Changes: -------- --- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes 2013-12-10 20:05:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.powerpc-utils.new/powerpc-utils.changes 2014-01-24 21:42:27.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Jan 10 16:58:09 UTC 2014 - jloeser@suse.com + +- version update to 1.2.18 (FATE#315785, FATE#316153, FATE#315495) + See changelog for changes + +------------------------------------------------------------------- Old: ---- powerpc-utils-1.2.17.tar.gz New: ---- powerpc-utils-1.2.18.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerpc-utils.spec ++++++ --- /var/tmp/diff_new_pack.6uHeYk/_old 2014-01-24 21:42:28.000000000 +0100 +++ /var/tmp/diff_new_pack.6uHeYk/_new 2014-01-24 21:42:28.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package powerpc-utils # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,7 +32,7 @@ Recommends: powerpc-utils-python BuildRequires: librtas-devel BuildRequires: zlib-devel -Version: 1.2.17 +Version: 1.2.18 Release: 0 Url: http://sourceforge.net/projects/powerpc-utils Summary: Utilities for PowerPC Hardware ++++++ powerpc-utils-1.2.17.tar.gz -> powerpc-utils-1.2.18.tar.gz ++++++ ++++ 2413 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/Changelog new/powerpc-utils-1.2.18/Changelog --- old/powerpc-utils-1.2.17/Changelog 2013-06-05 15:47:54.000000000 +0200 +++ new/powerpc-utils-1.2.18/Changelog 2013-09-18 17:31:50.000000000 +0200 @@ -1,3 +1,216 @@ +powerpc-utils-1.2.18 +===================================================================== +commit 1cb9a27a8751ee0f0d5d54de2e9b3e086618fc82 +Author: Philip Kelleher <pjk1939@linux.vnet.ibm.com> +Date: Tue Sep 10 11:15:52 2013 -0500 + + From: Philip Kelleher <pjk1939@linux.vnet.ibm.com> + + Added support for IBM Flash Adapter devices within the + snap script. + + The script will check whether or not IBM Flash + Adapters are currently loaded in the system. If so, the + script will check them. If not, the script will do its + normal operations. + + It will, then, check whether or not the rsxx-utils are + installed on the system. If they are installed, the rs_cardreport + application will be ran. If not, the script will print out + a warning stating that IBM Flash Adapter information could + not be gathered. The script will continue normally either + way. + + Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> + +commit 07165e5854b928d007ea2af1542a64c8d07c1336 +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Sep 10 11:13:49 2013 -0500 + + Allow frequency sampling for given time periods. + + This patch adds an option [-t <time> ] for the --frequency action in + ppc64_cpu so that users can specify the period in seconds over which + they want to do frequency sampling. + + Signed-off-by:Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit b2fb611e87ebdb27a6b923cf1ac076eb364870b8 +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Sep 10 11:12:19 2013 -0500 + + Acquire the dr_lock earlier in dr operations. + + The dr_lock used to serialize dr operations should be taken earlier. + The current code takes the lock after opening the log file, this can + lead to having multiple instances of drmgr writing to the file at the + same time. + + To do this, the patch moves the taking and releasing of the dr_lock into + the dr_init and dr_fini routines as well as cleans up main() to make + unlocking easier to handle. + + Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit d6a24ab18d9e48aa90712c4dcda69425f246287b +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Sep 10 10:46:33 2013 -0500 + + Update the drc-type descriptions for PCI-e Gen 3/4 slots + + This patch adds description strings for the newly added drc types + defined in the PAPR. Additionally, this initializes the description + string returned by node_type() to "Unknown", otherwise we could + return an uninitialized string. + + Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit 7b8150e442df2f41546cb3925019c9fcb8b5b59e +Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> +Date: Tue Sep 10 10:44:43 2013 -0500 + + Commit 8182dda resulted in excluding COPYRIGHT file from + gzip (make dist-gzip). This causes rpmbuild to fail. + + Adding COPYRIGHT file to EXTRA_DIST. + + Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> + +commit affd141c66cdd46a3a25ed7ad66e5c8096979b34 +Author: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> +Date: Tue Sep 10 10:42:54 2013 -0500 + + Handle addition of timestamp information in the oops header. New format + oops header has version in the same place as length in the old header. + Version is assigned a value greater than oops partition size (illegal length) + in kernel. If unzip_partition finds an illegal length, it will understand its + new style header and parse the information accordingly. With this --unzip + option will work with both old and new-style headers. + + Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> + +commit 06f85125973d87c12dd297dce51e5e5cf4d91f46 +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Jun 25 08:14:53 2013 -0500 + + drmgr: Post processing for PCI replace + + During a PCI replace operation we can hit scenarios where the adapter + was not able to completely clean everything up before it is removed. + Such a scenario would be an adapter completely failing or just being + pulled from its slot while the system is up. + + In these cases we need to add an additional remove and add to the flow + of operations in the replace code path. This allows us to add the + adapter back to the system which gives us enough to do a complete + remove and clean everything up, and then add the adapter again. + + Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit 04c9a8467022f75843e9a564f3b28e132544b9cc +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Jun 25 08:14:06 2013 -0500 + + drmgr: Ensure devices are present during pci replacement + + In some instance during a PCI replacement operations (drmgr -c pci -R) + the adapter we are adding does not immediately appear. In these cases + a small wait is required for the adapter to appear. + + This patch adds a small loop checking for the adapter's presence before + continuing the replace operation. The update also adds an option for + users to exit the operation if the adapter does not appear. + + Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit ff981e0e652364d9b3a3262d315d87e26c772135 +Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> +Date: Tue Jun 25 08:12:40 2013 -0500 + + drmgr: Check for rpadlpar_io module + + When attempting to do slot or phb DLPAR we need to have the rpadlpar_io + kernel module loaded. This patch updates the check made for slot and + phb DLPAR capabilities to also load the module if it is not present. + + Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> + +commit 8182dda83cae0d81b7c12c745ccae1932b0a52ac +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:11:10 2013 -0500 + + Makefile: Don't install docs twice + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit 288989572bcfdc272bce45e8600e7ce293184a3b +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:09:31 2013 -0500 + + nvram: Allow deleting variables + + nvram --update-config myvar= to delete a variable. + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit c4ea6a1cbf3d3be8b47132b3e2c6bcad638e3ef6 +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:08:01 2013 -0500 + + nvram: Write complete nvram data + + write() may not write the entire buffer we hand it. In this case, don't + fail, but advance along our buffer. + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit 1f7112d09affbf29bb354d7de3587fa2310a564d +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:07:11 2013 -0500 + + nvram: Allow new parameters to be added + + Currently, we exit from update_of_config_var if we don't see an existing + variable. This means we can't add new variables. + + Don't do this. + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit e2cc2e0e14f543a6b7e241d5a3951808eb829290 +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:06:16 2013 -0500 + + nvram: Check --update-config variables for correct format + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit 976dbe9bb7b01b135cac3e7bbd1dce0cdc88636a +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:05:21 2013 -0500 + + nvram: Allow zero-terminated output + + Currently, there's no way to accurately parse the outout of nvram + --print-config: properties may contain a newline, which we can't + distinguish from the end-of-property token. + + This change adds a --zero/-0 option to terminate config pairs with a + NUL character instead. + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + +commit 8d0fdf663e2a99b17bf8b001c59fb1cffaf7f185 +Author: Jeremy Kerr <jk@ozlabs.org> +Date: Tue Jun 25 08:03:55 2013 -0500 + + nvram: Don't use device tree for nvram size + + We can query the nvram size with a seek(), which means we don't need to + lookup in the device tree. + + Signed-off-by: Jeremy Kerr <jk@ozlabs.org> + powerpc-utils-1.2.17 ===================================================================== commit f54dc396cba599b1dc81892348b5db92743c9ff5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/Makefile.am new/powerpc-utils-1.2.18/Makefile.am --- old/powerpc-utils-1.2.17/Makefile.am 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/Makefile.am 2013-09-10 17:43:59.000000000 +0200 @@ -3,11 +3,10 @@ docdir = $(datadir)/doc/packages/@PACKAGE@ doc_DATA = README COPYRIGHT -dist_doc_DATA = README COPYRIGHT -EXTRA_DIST = Changelog powerpc-utils.spec.in doc/activate_firmware.doxycfg doc/nvram.doxycfg \ - doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg doc/set_poweron_time.doxycfg \ - doc/uesensor.doxycfg +EXTRA_DIST = COPYRIGHT Changelog powerpc-utils.spec.in doc/activate_firmware.doxycfg \ + doc/nvram.doxycfg doc/rtas_ibm_get_vpd.doxycfg doc/serv_config.doxycfg \ + doc/set_poweron_time.doxycfg doc/uesensor.doxycfg AC_CLEAN_FILES = aclocal.m4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/configure.ac new/powerpc-utils-1.2.18/configure.ac --- old/powerpc-utils-1.2.17/configure.ac 2013-06-05 15:43:58.000000000 +0200 +++ new/powerpc-utils-1.2.18/configure.ac 2013-09-18 17:26:28.000000000 +0200 @@ -1,6 +1,6 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define([ppu_version], 1.2.17) +m4_define([ppu_version], 1.2.18) AC_PREREQ([2.63]) AC_INIT([powerpc-utils], ppu_version, [nfont@linux.vnet.ibm.com]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/scripts/snap new/powerpc-utils-1.2.18/scripts/snap --- old/powerpc-utils-1.2.17/scripts/snap 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/scripts/snap 2013-09-10 18:14:58.000000000 +0200 @@ -30,6 +30,7 @@ my $outfile = "snap.tar.gz"; # in the working dir. my $cmddir = "snap_commands"; # cmd output dir. my $cmdoutdir = "$outdir/$cmddir"; # in outdir dir. +my $rsxx_exists = 0; # Does an IBM Flash Adapter exist? our($opt_a, $opt_d, $opt_h, $opt_o, $opt_t, $opt_v); @@ -120,6 +121,11 @@ "ppc64_cpu --smt --cores-present --cores-on --run-mode --frequency --dscr", ); +# Command output to include for IBM Flash Adapter(s) +my @snap_command_rsxx = ( + "rs_cardreport -d 'all'", +); + sub recurse_dir($); # function prototype sub error { @@ -350,6 +356,11 @@ exit 2; } +# Check to see if we need to gather information on IBM Flash Adapter(s). +if (glob("/dev/rsxx*")) { + $rsxx_exists = 1; +} + snap_paths(@snap_paths_general); # Check distro @@ -369,6 +380,19 @@ snap_commands(@snap_commands_detailed); } +# Gather information regarding IBM Flash Adapter(s) +if ($rsxx_exists) { + # Verify the rsxx utils are installed. + system("rpm -qa | grep rsxx-utils > /dev/null"); + if ($? == 0) { + snap_commands(@snap_command_rsxx); + } else { + print "Warning: The rsxx-utils RPM are not installed, ". + "unable to gather IBM Flash Adapter information.\n". + "\t Run 'yum install rsxx-utils' to install.\n"; + } +} + my ($basefile, $extension) = split /\.tar/, $outfile; my $basedir = substr $outdir, 0, rindex($outdir, "/"); my $compressdir = substr $outdir, rindex($outdir, "/") + 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/drmgr/common.c new/powerpc-utils-1.2.18/src/drmgr/common.c --- old/powerpc-utils-1.2.17/src/drmgr/common.c 2013-05-30 04:05:40.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/drmgr/common.c 2013-09-10 17:47:13.000000000 +0200 @@ -16,6 +16,7 @@ #include <dirent.h> #include <execinfo.h> #include <ctype.h> +#include <sys/wait.h> #include "dr.h" #include "ofdt.h" @@ -87,9 +88,19 @@ * @brief Initialization routine for drmgr and lsslot * */ -inline void +inline int dr_init(void) { + int rc; + + rc = dr_lock(); + if (rc) { + say(ERROR, "Unable to obtain Dynamic Reconfiguration lock. " + "Please try command again later.\n"); + return -1; + } + + log_fd = open(DR_LOG_PATH, O_RDWR | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); if (log_fd == -1) { @@ -105,6 +116,14 @@ strftime(tbuf, 128, "%b %d %T %G", localtime(&t)); say(DEBUG, "\n########## %s ##########\n", tbuf); } + + /* Mask signals so we do not get interrupted */ + if (sig_setup()) { + say(ERROR, "Could not mask signals to avoid interrupts\n"); + return -1; + } + + return 0; } /** @@ -158,6 +177,8 @@ return; } } + + dr_unlock(); } /** @@ -725,7 +746,6 @@ backtrace_symbols_fd(callstack, sz, log_fd); } - dr_unlock(); dr_fini(); exit(-1); } @@ -827,17 +847,29 @@ "PCI-E capable, Rev 2, 8x lanes", "PCI-E capable, Rev 2, 16x lanes", "PCI-E capable, Rev 2, 32x lanes", /* 30 */ + "PCI-E capable, Rev 3, 8x lanes with 1 lane connected", + "PCI-E capable, Rev 3, 8x lanes with 4x lanes connected", + "PCI-E capable, Rev 3, 8x lanes with 8x lanes connected", + "PCI-E capable, Rev 3, 16x lanes with 1 lane connected", + "PCI-E capable, Rev 3, 16x lanes with 8x lanes connected", /* 35 */ + "PCI-E capable, Rev 3, 16x lanes with 16x lanes connected", + "PCI-E capable, Rev 4, 8x lanes with 1 lane connected", + "PCI-E capable, Rev 4, 8x lanes with 4x lanes connected", + "PCI-E capable, Rev 4, 8x lanes with 8x lanes connected", + "PCI-E capable, Rev 4, 16x lanes with 1 lane connected", /* 40 */ + "PCI-E capable, Rev 4, 16x lanes with 8x lanes connected", + "PCI-E capable, Rev 4, 16x lanes with 16x lanes connected", }; char * node_type(struct dr_node *node) { int desc_msg_num; - char *desc; + char *desc = "Unknown"; desc_msg_num = atoi(node->drc_type); if ((desc_msg_num >= 1 && desc_msg_num <= 8) || - (desc_msg_num >= 11 && desc_msg_num <= 30)) + (desc_msg_num >= 11 && desc_msg_num <= 42)) desc = php_slot_type_msg[desc_msg_num]; else { switch (node->dev_type) { @@ -1152,8 +1184,19 @@ static int check_slot_phb_dlpar(const char *type) { + struct stat sbuf; int rc; + /* Before checking for dlpar capability, we need to ensure that + * rpadlpar_io module is loaded or built into the kernel. This + * does make the checking a bit redundant though. + */ + if ((stat(dlpar_add_slot, &sbuf)) || (stat(DLPAR_ADD_SLOT2, &sbuf))) { + rc = system("/sbin/modprobe rpadlpar_io"); + if (WIFEXITED(rc) && WEXITSTATUS(rc)) + say(ERROR, "rpadlpar_io module was not loaded\n"); + } + /* For unknown reasons the add_slot and remove_slot sysfs files * used for dlpar operations started appearing with quotes around * the filename. So, this little hack exists to ensure nothing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/drmgr/dr.h new/powerpc-utils-1.2.18/src/drmgr/dr.h --- old/powerpc-utils-1.2.17/src/drmgr/dr.h 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/drmgr/dr.h 2013-09-10 17:47:13.000000000 +0200 @@ -77,7 +77,7 @@ int say(enum say_level, char *, ...); void report_unknown_error(char *, int); void report_alloc_error(); -void dr_init(void); +int dr_init(void); void dr_fini(void); void set_timeout(int); int drmgr_timed_out(void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/drmgr/drmgr.c new/powerpc-utils-1.2.18/src/drmgr/drmgr.c --- old/powerpc-utils-1.2.17/src/drmgr/drmgr.c 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/drmgr/drmgr.c 2013-09-10 17:47:13.000000000 +0200 @@ -299,59 +299,57 @@ return -1; } -int -main(int argc, char *argv[]) +struct command * +parse_and_validate_options(int argc, char *argv[], struct options *opts) { - struct options opts; - char log_msg[DR_PATH_MAX]; - struct command *command; - int i, offset; + struct command *command = NULL; int rc; - parse_options(argc, argv, &opts); + parse_options(argc, argv, opts); if (display_capabilities) { print_dlpar_capabilities(); - rc = 0; - goto exit; + return NULL; } - command = get_command(&opts); + command = get_command(opts); if (display_usage) { command_usage(command); - rc = 0; - goto exit; + return NULL; } - dr_init(); - /* Validate the options for the action we want to perform */ - rc = command->validate_options(&opts); + rc = command->validate_options(opts); if (rc) - goto exit; + return NULL; /* Validate this platform */ - if (! valid_platform("chrp")) { - rc = 1; - goto exit; - } + if (!valid_platform("chrp")) + return NULL; - /* Mask signals so we do not get interrupted */ - if (sig_setup()) { - say(ERROR, "Could not mask signals to avoid interrupts\n"); - rc = -1; - goto exit; + return command; +} + +int +main(int argc, char *argv[]) +{ + struct options opts; + char log_msg[DR_PATH_MAX]; + struct command *command; + int i, rc, offset; + + rc = dr_init(); + if (rc) + return rc; + + command = parse_and_validate_options(argc, argv, &opts); + if (!command) { + dr_fini(); + return -1; } set_timeout(opts.timeout); - rc = dr_lock(); - if (rc) { - say(ERROR, "Unable to obtain Dynamic Reconfiguration lock. " - "Please try command again later.\n"); - rc = -1; - goto exit; - } /* Log this invocation to /var/log/messages and /var/log/drmgr */ offset = sprintf(log_msg, "drmgr: "); @@ -365,8 +363,5 @@ /* Now, using the actual command, call out to the proper handler */ rc = command->func(&opts); - dr_unlock(); -exit: - dr_fini(); return rc; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/drmgr/drslot_chrp_pci.c new/powerpc-utils-1.2.18/src/drmgr/drslot_chrp_pci.c --- old/powerpc-utils-1.2.17/src/drmgr/drslot_chrp_pci.c 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/drmgr/drslot_chrp_pci.c 2013-09-10 17:39:51.000000000 +0200 @@ -133,6 +133,36 @@ return node; } +static int check_card_presence(struct options *opts, struct dr_node *node) +{ + int i, state, keep_working; + + say(DEBUG, "Waiting for the card to appear...\n"); + do { + keep_working = 0; + + for (i = 0; i < 30; i++) { + state = dr_entity_sense(node->drc_index); + if (state != EMPTY) + return state; + + sleep(1); + } + + if (0 == opts->noprompt) { + printf("The card still does not appear to be present" + "\npress Enter to continue to wait or enter " + "'x' to exit.\n"); + + if ((getchar() == '\n')) + keep_working = 1; + } + + } while (keep_working); + + return state; +} + /** * card_present * @brief Determines if there is a card present in the specified slot @@ -144,22 +174,23 @@ * maybe isolate and try sensing again. If we hit fatal errors, call * error_exit to clean up and exit the command. * + * @param opts * @param slot pointer to slot we're checking * @param power_state state of power when we leave this routine * @param isolate_state state of isolation when we leave this routine * @returns EMPTY or PRESENT */ static int -card_present(struct dr_node *node, int *power_state, int *isolate_state) +card_present(struct options *opts, struct dr_node *node, int *power_state, + int *isolate_state) { int state, rc; *power_state = POWER_OFF; /* initialize */ *isolate_state = ISOLATE; - state = dr_entity_sense(node->drc_index); + state = check_card_presence(opts, node); if ((state == EMPTY) || (state == PRESENT)) - /* if we get an answer, we're done */ return state; else if (state == HW_ERROR) { @@ -211,7 +242,7 @@ /* Now we have power on, and the unisolate is done * if it was needed. check for card again. */ - state = dr_entity_sense(node->drc_index); + state = check_card_presence(opts, node); if ((state == EMPTY) || (state == PRESENT)) return state; @@ -289,11 +320,12 @@ * If the OF tree cannot be updated, the slot is powered * off, isolated, and the LED is turned off. * + * @param opts * @param slot * @returns 0 on success, !0 on failure */ static int -add_work(struct dr_node *node) +add_work(struct options *opts, struct dr_node *node) { int pow_state; /* Tells us if power was turned on when */ int iso_state; /* Tells us isolation state after */ @@ -305,7 +337,7 @@ return -1; say(DEBUG, "is calling card_present\n"); - rc = card_present(node, &pow_state, &iso_state); + rc = card_present(opts, node, &pow_state, &iso_state); if (!rc) { say(ERROR, "No PCI card was detected in the specified " "PCI slot.\n"); @@ -482,7 +514,7 @@ /* Call the routine which determines * what the user wants and does it. */ - rc = add_work(node); + rc = add_work(opts, node); if (rc) return rc; @@ -563,6 +595,13 @@ say(ERROR, "Unconfig adapter failed.\n"); return NULL; } + } else { + /* In certain cases such as a complete failure of the + * adapter there may not have been the possibility to clean + * up everything. Mark these adapaters for additional + * processing later. + */ + node->post_replace_processing = 1; } /* Call subroutine to remove node(s) from @@ -722,7 +761,7 @@ } } - rc = add_work(repl_node); + rc = add_work(opts, repl_node); if (rc) return rc; @@ -731,7 +770,23 @@ set_hp_adapter_status(PHP_CONFIG_ADAPTER, repl_node->drc_name); - return 0; + if (repl_node->post_replace_processing) { + int prompt_save = opts->noprompt; + + say(DEBUG, "Doing post replacement processing...\n"); + /* disable prompting for post-processing */ + opts->noprompt = 1; + + repl_node = remove_work(opts, repl_node); + rc = add_work(opts, repl_node); + if (!rc) + set_hp_adapter_status(PHP_CONFIG_ADAPTER, + repl_node->drc_name); + + opts->noprompt = prompt_save; + } + + return rc; } int diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/drmgr/ofdt.h new/powerpc-utils-1.2.18/src/drmgr/ofdt.h --- old/powerpc-utils-1.2.17/src/drmgr/ofdt.h 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/drmgr/ofdt.h 2013-09-10 17:39:51.000000000 +0200 @@ -70,7 +70,8 @@ uint32_t skip:1; uint32_t unusable:1; uint32_t is_removable:1; - uint32_t reserved:28; + uint32_t post_replace_processing:1; + uint32_t reserved:27; union { struct mem_info { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/nvram.c new/powerpc-utils-1.2.18/src/nvram.c --- old/powerpc-utils-1.2.17/src/nvram.c 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/nvram.c 2013-09-10 17:41:04.000000000 +0200 @@ -57,6 +57,7 @@ static struct option long_options[] = { {"verbose", optional_argument, NULL, 'v'}, {"print-config", optional_argument, NULL, 'o'}, + {"zero", optional_argument, NULL, '0'}, {"print-vpd", optional_argument, NULL, 'V'}, {"print-all-vpd", optional_argument, NULL, 'W'}, {"print-err-log", no_argument, NULL, 'e'}, @@ -84,6 +85,8 @@ " --print-config[=var]\n" " print value of a config variable, or print all variables in\n" " the specified (or all) partitions\n" + " --zero | -0\n" + " terminate config pairs with a NUL character\n" " --update-config <var>=<value>\n" " update the config variable in the specified partition; the -p\n" " option must also be specified\n" @@ -192,199 +195,6 @@ } /** - * resolve_of_node - * @brief resolve an Open Firmware node name - * - * In a device tree node with a single child, "foo@0", all of the following - * names refer to that child: "foo@0", "foo", "@0". - * - * @param parent fully-qualified path to the parent device node - * @param node the (possibly abbreviated) name of the child node - * @param nodelen length of the node parameter - * @param resolved pointer to return resolved node name in - * @return 0 if a suitable child can be found, and 'resolved' is a - * dynamically-allocated string containing the resolved node name. - * Otherwise, -1. - */ -static int -resolve_of_node(const char *parent, const char *node, int nodelen, - char **resolved) -{ - static char nodebuf[1024]; /* XXX hardcoded length */ - struct stat sbuf; - glob_t pglob; - int rc; - - *resolved = NULL; - - snprintf(nodebuf, sizeof(nodebuf), "%s/%.*s", parent, - nodelen, node); - rc = stat(nodebuf, &sbuf); - if (rc != -1) { - *resolved = malloc(nodelen+2); - snprintf(*resolved, nodelen+2, "/%.*s", nodelen, node); - goto out; - } - if (errno != ENOENT) - goto out; /* report unusual errors */ - - if (node[0] == '@') { - /* it's a unit address; glob for *@unitaddr */ - snprintf(nodebuf, sizeof(nodebuf), "%s/*%.*s*", parent, nodelen, node); - rc = glob(nodebuf, 0, NULL, &pglob); - if (rc == 0) { - if (pglob.gl_pathc > 1) { - err_msg("Ambiguous node name \"%.*s\"\n", nodelen, node); - while (pglob.gl_pathc) { - free(pglob.gl_pathv[pglob.gl_pathc]); - pglob.gl_pathc--; - } - goto out; - } - - /* skip the leading fully-qualified path */ - *resolved = strdup(pglob.gl_pathv[0] + strlen(parent)); - free(pglob.gl_pathv[0]); - goto out; - } - } else { - /* must be a node name; glob for node@* */ - snprintf(nodebuf, sizeof(nodebuf), "%s/%.*s@*", parent, nodelen, node); - rc = glob(nodebuf, 0, NULL, &pglob); - if (rc == 0) { - if (pglob.gl_pathc > 1) { - err_msg("Ambiguous node name \"%.*s\"\n", nodelen, node); - while (pglob.gl_pathc) { - free(pglob.gl_pathv[pglob.gl_pathc]); - pglob.gl_pathc--; - } - goto out; - } - - /* skip the leading fully-qualified path */ - *resolved = strdup(pglob.gl_pathv[0] + strlen(parent)); - free(pglob.gl_pathv[0]); - goto out; - } - } - -out: - if (*resolved != NULL) - return 0; - return -1; -} - -/** - * open_of_path - * @brief open an Open Firmware path under DEVICE_TREE - * - * @param ofpath the path to open, such as "/pci/@d/mac-io/nvram/#bytes" - * - * An Open Firmware path may contain "shortcut" node names that are not present - * under /proc/device-tree. In the above example, we may need to open - * "pci@80000000" instead of "pci". - * - * @return file descriptor to the opened node, or -1 on failure - */ -static int -open_of_path(const char *ofpath) -{ - static char resolved_ofpath[1024]; /* XXX hardcoded length */ - const char *node; - int fd = -1; - int rc = 0; - - strcpy(resolved_ofpath, DEVICE_TREE); - - while (ofpath) { - int nodelen; - char *resolved_node; - - node = ofpath + 1; - ofpath = strchr(node + 1, '/'); - - nodelen = ofpath - node; - if (ofpath == NULL) - nodelen = strlen(node); - - rc = resolve_of_node(resolved_ofpath, node, nodelen, &resolved_node); - if (rc < 0) - break; - - strcat(resolved_ofpath, resolved_node); - free(resolved_node); - } - - if (rc >= 0) - fd = open(resolved_ofpath, O_RDONLY); - - return fd; -} - -/** - * get_of_nvram_size - * @brief Get the size of nvram from the device tree - * - * Retrieve the size of nvram as specified by the Open Firmware - * device tree. If this fails we return a default size of - * 1024 * 1024. - * - * @return size of nvram - */ -static int -get_of_nvram_size(void) -{ - char buf[1024] = NVRAM_DEFAULT "/#bytes"; - int fd; - int size, len; - - fd = open(buf, O_RDONLY); - if (fd == -1) { - /* Check the aliases directory */ - struct stat sbuf; - int offset; - - fd = open(NVRAM_ALIAS, O_RDONLY); - if (fd == -1) { - err_msg("%s", "Could not determine nvram size from " - NVRAM_ALIAS "\n"); - return DEFAULT_NVRAM_SZ; - } - - if (fstat(fd, &sbuf) != 0) { - err_msg("%s", "Could not determine nvram size from " - NVRAM_ALIAS "\n"); - close(fd); - return DEFAULT_NVRAM_SZ; - } - - offset = read(fd, buf, sbuf.st_size - 1); - offset += sprintf(buf + offset, "%s", "/#bytes"); - buf[offset] = '\0'; - - close(fd); - fd = open_of_path(buf); - } - - if (fd == -1) { - warn_msg("cannot open nvram node \"%s\" in device tree: %s\n", buf, - strerror(errno)); - close(fd); - return DEFAULT_NVRAM_SZ; - } - - len = read(fd, &size, sizeof(size)); - close(fd); - - if (len != sizeof(size)) { - perror("got odd size for nvram node in device tree"); - return DEFAULT_NVRAM_SZ; - } - - return size; -} - -/** * nvram_read * @brief read in the contents of nvram * @@ -1299,7 +1109,16 @@ next = start + sizeof(*phead); /* Skip partition header. */ next += sizeof(struct err_log_info); /* Skip sub-header. */ zipped_length = *((unsigned short*) next); - next += sizeof(unsigned short); /* Skip compressed length. */ + next += sizeof(unsigned short); + + /* New format oops header, zipped_length > OOPS_PARTITION_SZ + * signifies the version of new header. Find out new zipped length + * and from where the compressed data starts. + */ + if (zipped_length > OOPS_PARTITION_SZ) { + zipped_length = *((unsigned short*) next); + next += sizeof(struct oops_log_info) - sizeof(unsigned short); + } if ((next-start) + zipped_length > phead->length * NVRAM_BLOCK_SIZE) { err_msg("bogus size for compressed data in partition %s: %u\n", name, @@ -1374,13 +1193,18 @@ * @return 0 on success, !0 otherwise */ static int -print_of_config(struct nvram *nvram, char *config_var, char *pname) +print_of_config(struct nvram *nvram, char *config_var, char *pname, + int zero_terminator) { struct partition_header *phead; - char *data; + char *data, terminator; int i, varlen; int rc = -1; + terminator = '\n'; + if (zero_terminator) + terminator = '\0'; + /* if config_var is NULL , print the data from the * partition specified by pname or all of the * name/value pair partitions if pname is NULL. @@ -1417,7 +1241,7 @@ while (*data != '\0') { if ((data[varlen] == '=') && strncmp(config_var, data, varlen) == 0) { - printf("%s\n", data + varlen + 1); + printf("%s%c", data + varlen + 1, terminator); rc = 0; } data += strlen(data) + 1; @@ -1435,7 +1259,7 @@ while (*data != '\0') { if ((data[varlen] == '=') && strncmp(config_var, data, varlen) == 0) { - printf("%s\n", data + varlen + 1); + printf("%s%c", data + varlen + 1, terminator); rc = 0; } data += strlen(data) + 1; @@ -1463,12 +1287,20 @@ update_of_config_var(struct nvram *nvram, char *config_var, char *pname) { struct partition_header *phead, *new_phead; + char *new_config_value; char *data_offset; char *new_part; char *new_part_offset, *new_part_end; char *tmp_offset; int config_name_len; - int len, part_size, found = 0; + int len, rc, part_size; + + new_config_value = strchr(config_var, '='); + if (!new_config_value) { + err_msg("config variables must be in the format \"name=value\""); + return -1; + } + new_config_value++; phead = nvram_find_partition(nvram, 0, pname, NULL); if (phead == NULL) { @@ -1493,20 +1325,9 @@ /* now find this config variable in the partition */ while (*data_offset != '\0') { - if (strncmp(data_offset, config_var, config_name_len) == 0) { - found = 1; + if (strncmp(data_offset, config_var, config_name_len) == 0) break; - } - else - data_offset += strlen(data_offset) + 1; - } - - if (!found) { - err_msg("cannot update %s\n" - "\tThe config var does not exist in the \"%s\" partition\n", - config_var, pname); - free(new_part); - return -1; + data_offset += strlen(data_offset) + 1; } /* Copy everything up to the config name we are modifying @@ -1527,9 +1348,11 @@ return -1; } - strncpy(new_part_offset, config_var, strlen(config_var)); - new_part_offset += strlen(config_var); - *new_part_offset++ = '\0'; + if (strlen(new_config_value)) { + strncpy(new_part_offset, config_var, strlen(config_var)); + new_part_offset += strlen(config_var); + *new_part_offset++ = '\0'; + } /* Find the end of the name/value pairs in the partition so we * can copy them over to the new partition. @@ -1571,7 +1394,12 @@ } /* write the partition out to nvram */ - len = write(nvram->fd, new_part, part_size); + for (rc = 0, len = 0; len < part_size; len += rc) { + rc = write(nvram->fd, new_part + len, part_size - len); + if (rc <= 0) + break; + } + if (len != part_size) { err_msg("only wrote %d bytes of the \"%s\" partition back\n" "\tto %s, expected to write %d bytes\n", @@ -1588,7 +1416,6 @@ struct nvram nvram; struct stat sbuf; int ret = 0; - int of_nvram_size; int option_index; char *endp; char *of_config_var = NULL; @@ -1597,6 +1424,7 @@ int print_errlog = 0; int print_event_scan = 0; int print_config_var = 0; + int zero_terminator = 0; char *dump_name = NULL; char *ascii_name = NULL; char *zip_name = NULL; @@ -1615,7 +1443,7 @@ for (;;) { option_index = 0; - ret = getopt_long(argc, argv, "+p:Vv::", long_options, &option_index); + ret = getopt_long(argc, argv, "+p:Vv::0", long_options, &option_index); if (ret == -1) break; switch (ret) { @@ -1641,6 +1469,9 @@ print_config_var = 1; of_config_var = optarg; break; + case '0': + zero_terminator = 1; + break; case 'P': /* partitions */ print_partitions = 1; break; @@ -1720,11 +1551,22 @@ goto err_exit; } - of_nvram_size = get_of_nvram_size(); - nvram.nbytes = sbuf.st_size ? sbuf.st_size : of_nvram_size; - if (nvram.nbytes != of_nvram_size) { - warn_msg("specified nvram size %d does not match this machine %d!\n", - nvram.nbytes, of_nvram_size); + if (!nvram.nbytes) { + ret = lseek(nvram.fd, 0, SEEK_END); + if (ret < 0) { + err_msg("cannot seek(END) %s: %s\n", nvram.filename, + strerror(errno)); + goto err_exit; + } + + nvram.nbytes = ret; + + ret = lseek(nvram.fd, 0, SEEK_SET); + if (ret < 0) { + err_msg("cannot seek(SET) %s: %s\n", nvram.filename, + strerror(errno)); + goto err_exit; + } } nvram.data = malloc(nvram.nbytes); @@ -1757,7 +1599,8 @@ ret = -1; } if (print_config_var) - if (print_of_config(&nvram, of_config_var, config_pname) != 0) + if (print_of_config(&nvram, of_config_var, config_pname, + zero_terminator) != 0) ret = -1; if (print_vpd) if (dump_vpd(&nvram, print_vpd == 2) != 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/nvram.h new/powerpc-utils-1.2.18/src/nvram.h --- old/powerpc-utils-1.2.17/src/nvram.h 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/nvram.h 2013-09-10 17:41:04.000000000 +0200 @@ -34,11 +34,8 @@ #define NVRAM_FILENAME1 "/dev/nvram" #define NVRAM_FILENAME2 "/dev/misc/nvram" -#define DEVICE_TREE "/proc/device-tree" -#define NVRAM_DEFAULT DEVICE_TREE "/nvram" -#define NVRAM_ALIAS DEVICE_TREE "/aliases/nvram" - #define DEFAULT_NVRAM_SZ (1024 * 1024) +#define OOPS_PARTITION_SZ 4000 /** * @def MAX_CPUS @@ -63,6 +60,13 @@ unsigned int seq_num; }; +/* lnx,oops-log header */ +struct oops_log_info { + unsigned short version; + unsigned short report_length; + unsigned long long timestamp; +}; + /* Internal representation of NVRAM. */ #define MAX_PARTITIONS 50 /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/powerpc-utils-1.2.17/src/ppc64_cpu.c new/powerpc-utils-1.2.18/src/ppc64_cpu.c --- old/powerpc-utils-1.2.17/src/ppc64_cpu.c 2013-05-30 03:47:15.000000000 +0200 +++ new/powerpc-utils-1.2.18/src/ppc64_cpu.c 2013-09-10 18:12:58.000000000 +0200 @@ -836,7 +836,9 @@ setrlimit(RLIMIT_NOFILE, &new_rlim); } -int do_cpu_frequency(void) +#define freq_calc(cycles, time) (1.0 * (cycles) / (time) / 1000000000ULL) + +int do_cpu_frequency(int sleep_time) { int i, rc; unsigned long long min = -1ULL; @@ -874,8 +876,8 @@ usleep(1000000); start_counters(); - /* Count for 1 second */ - usleep(1000000); + /* Count for specified timeout in seconds */ + usleep(sleep_time * 1000000); stop_counters(); read_counters(); @@ -903,11 +905,11 @@ } report_system_power_mode(); - printf("min:\t%.3f GHz (cpu %ld)\n", 1.0 * min / 1000000000ULL, + printf("min:\t%.3f GHz (cpu %ld)\n", freq_calc(min, sleep_time), min_cpu); - printf("max:\t%.3f GHz (cpu %ld)\n", 1.0 * max / 1000000000ULL, + printf("max:\t%.3f GHz (cpu %ld)\n", freq_calc(max, sleep_time), max_cpu); - printf("avg:\t%.3f GHz\n\n", 1.0 * (sum / count) / 1000000000ULL); + printf("avg:\t%.3f GHz\n\n", freq_calc((sum / count), sleep_time)); return 0; } @@ -1061,7 +1063,8 @@ "ppc64_cpu --smt-snooze-delay=<val> # Change smt-snooze-delay setting\n\n" "ppc64_cpu --run-mode # Get current diagnostics run mode\n" "ppc64_cpu --run-mode=<val> # Set current diagnostics run mode\n\n" -"ppc64_cpu --frequency # Determine cpu frequency.\n\n"); +"ppc64_cpu --frequency [-t <time>] # Determine cpu frequency for <time>\n" +" # seconds, default is 1 second.\n\n"); } struct option longopts[] = { @@ -1083,6 +1086,7 @@ char *action_arg = NULL; char *equal_char; int opt; + int sleep_time = 1; /* default to one second */ pid_t pid = -1; if (argc == 1) { @@ -1111,12 +1115,10 @@ action_arg = equal_char + 1; } - /* Now parse out any additional options. Currently there is only - * the -p <pid> option for the --dscr action. - */ + /* Now parse out any additional options. */ optind = 2; while (1) { - opt = getopt(argc, argv, "p:"); + opt = getopt(argc, argv, "p:t:"); if (opt == -1) break; @@ -1132,6 +1134,17 @@ pid = atoi(optarg); break; + case 't': + /* only valid for --frequency */ + if (strcmp(action, "frequency")) { + fprintf(stderr, "The t option is only valid " + "with the --frequency option\n"); + usage(); + exit(-1); + } + + sleep_time = atoi(optarg); + break; default: fprintf(stderr, "%c is not a valid option\n", opt); usage(); @@ -1148,7 +1161,7 @@ else if (!strcmp(action, "run-mode")) rc = do_run_mode(action_arg); else if (!strcmp(action, "frequency")) - rc = do_cpu_frequency(); + rc = do_cpu_frequency(sleep_time); else if (!strcmp(action, "cores-present")) rc = do_cores_present(action_arg); else if (!strcmp(action, "cores-on")) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de