Hello community,

here is the log from the commit of package iprutils for openSUSE:Factory 
checked in at 2017-03-10 21:45:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/iprutils (Old)
 and      /work/SRC/openSUSE:Factory/.iprutils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "iprutils"

Fri Mar 10 21:45:01 2017 rev:57 rq:477561 version:2.4.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/iprutils/iprutils.changes        2017-02-08 
12:12:53.336067017 +0100
+++ /work/SRC/openSUSE:Factory/.iprutils.new/iprutils.changes   2017-03-10 
21:45:02.629188128 +0100
@@ -1,0 +2,15 @@
+Wed Mar  1 17:27:15 UTC 2017 - [email protected]
+
+- version update to 2.4.14 (fate#321592)
+  - Remove sleeps from iprconfig initialization
+  - Filter out JBOD HDDs from the device statistics menu
+  - Allow VSET write cache in bare metal mode
+  - Fix raid-create on dual adapter setups
+  - Wait for sg module
+  - Disable rebuild verify by default for single adapter configurations
+  - Remove stale debug printf
+  - Vset cache enable fixes
+  - Backwards compatibility for endian swapped device_id
+  - Fix iprconfig dump option to log full IOA details
+
+-------------------------------------------------------------------

Old:
----
  iprutils-2.4.13.tar.gz

New:
----
  iprutils-2.4.14.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ iprutils.spec ++++++
--- /var/tmp/diff_new_pack.7z7HvN/_old  2017-03-10 21:45:03.293093964 +0100
+++ /var/tmp/diff_new_pack.7z7HvN/_new  2017-03-10 21:45:03.293093964 +0100
@@ -19,7 +19,7 @@
 Name:           iprutils
 # NOTE: package's changelog is hidden in % changelog section
 # in file iprutils/spec/iprutils.spec
-Version:        2.4.13
+Version:        2.4.14
 Release:        0
 %define         ibmformat %(sed 's/\\./-/g' <<< %{version})
 Summary:        Utilities for the IBM Power Linux RAID Adapters

++++++ iprutils-2.4.13.tar.gz -> iprutils-2.4.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/configure.ac 
new/iprutils-rel-2-4-14/configure.ac
--- old/iprutils-rel-2-4-13/configure.ac        2016-08-16 16:47:13.000000000 
+0200
+++ new/iprutils-rel-2-4-14/configure.ac        2016-10-25 22:57:44.000000000 
+0200
@@ -10,7 +10,7 @@
 AC_PREREQ([2.63])
 # For RC releases, version should be set to 2.4.10.0.rc1, 2.4.10.0.rc2, etc.
 # For GA releases, version should be set to 2.4.10.1, 2.4.10.2, etc.
-AC_INIT([iprutils], [2.4.13.1], [[email protected]])
+AC_INIT([iprutils], [2.4.14.1], [[email protected]])
 
 AM_INIT_AUTOMAKE([1.9 foreign])
 AC_CONFIG_MACRO_DIR([build-aux])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/iprconfig.c 
new/iprutils-rel-2-4-14/iprconfig.c
--- old/iprutils-rel-2-4-13/iprconfig.c 2016-08-16 16:47:13.000000000 +0200
+++ new/iprutils-rel-2-4-14/iprconfig.c 2016-10-25 22:57:44.000000000 +0200
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <libgen.h>
 
 #include <math.h>
 
@@ -1803,7 +1804,7 @@
        for_each_ioa(ioa) {
                for (j = 0; j < ioa->num_devices; j++) {
                        scsi_dev_data = ioa->dev[j].scsi_dev_data;
-                       if (!scsi_dev_data || scsi_dev_data->type == 
IPR_TYPE_ADAPTER)
+                       if (ipr_is_ioa(&ioa->dev[j]))
                                continue;
                        verify_device(&ioa->dev[j]);
                }
@@ -2819,7 +2820,7 @@
        if ((rc = device_details_get_device(i_con, &dev)))
                return rc;
 
-       if (dev->scsi_dev_data && dev->scsi_dev_data->type == IPR_TYPE_ADAPTER) 
{
+       if (ipr_is_ioa(dev)) {
                n_screen = &n_adapter_details;
                body = ioa_details(body, dev);
        } else if (ipr_is_volume_set(dev)) {
@@ -2885,6 +2886,8 @@
        char *buffer[2];
        int toggle = 1;
        struct ipr_dev *vset;
+       struct ipr_sas_std_inq_data std_inq;
+
        processing();
 
        rc = RC_SUCCESS;
@@ -2897,7 +2900,18 @@
                if (!ioa->ioa.scsi_dev_data)
                        continue;
 
-               num_lines += print_standalone_disks(ioa, &i_con, buffer, 2);
+               __for_each_standalone_disk(ioa, dev) {
+                       if (ipr_is_gscsi(dev)) {
+                               rc = ipr_inquiry(dev, IPR_STD_INQUIRY, 
&std_inq, sizeof(std_inq));
+                               if (rc || !std_inq.is_ssd)
+                                       continue;
+                       }
+
+                       print_dev(k, dev, buffer, "%1", 2+k);
+                       i_con = add_i_con(i_con, "\0", dev);
+                       num_lines++;
+               }
+
                num_lines += print_hotspare_disks(ioa, &i_con, buffer, 2);
 
                for_each_vset(ioa, vset) {
@@ -8025,6 +8039,9 @@
                if (ses_path_len != res_path_len)
                        continue;
 
+               if (ipr_is_volume_set(dev) || ipr_is_array(dev))
+                       continue;
+
                for_each_rp(rp, dev) {
                        if ( !memcmp(&rp->res_path_bytes, &ses->res_path[0], 
ses_path_len/3) && slot == dev_slot ) {
 
@@ -11771,7 +11788,7 @@
                        time_screen_driver(&n_download_ucode_in_progress, time, 
0);
                } while (done == 0);                    
        } else {
-               if (dev->scsi_dev_data && dev->scsi_dev_data->type == 
IPR_TYPE_ADAPTER)
+               if (ipr_is_ioa(dev))
                        ipr_update_ioa_fw(dev->ioa, fw_image, 1);
                else
                        ipr_update_disk_fw(dev, fw_image, 1);
@@ -11905,7 +11922,7 @@
 
        if (!dev->scsi_dev_data)
                return 67 | EXIT_FLAG;
-       if (dev->scsi_dev_data->type == IPR_TYPE_ADAPTER)
+       if (ipr_is_ioa(dev))
                rc = get_ioa_firmware_image_list(dev->ioa, &list);
        else if (dev->scsi_dev_data->type == TYPE_ENCLOSURE || 
dev->scsi_dev_data->type == TYPE_PROCESSOR)
                rc = get_ses_firmware_image_list(dev, &list);
@@ -11919,8 +11936,7 @@
 
        ipr_get_fw_version(dev, release_level);
 
-       if (dev->scsi_dev_data &&
-           dev->scsi_dev_data->type == IPR_TYPE_ADAPTER) {
+       if (ipr_is_ioa(dev)) {
                sprintf(buffer, _("Adapter to download: %-8s %-16s\n"),
                        dev->scsi_dev_data->vendor_id,
                        dev->scsi_dev_data->product_id);
@@ -12895,7 +12911,7 @@
        int initialization_in_progress = 0;
        struct ipr_res_redundancy_info info;
 
-       if (scsi_dev_data && scsi_dev_data->type == IPR_TYPE_ADAPTER && dev == 
&ioa->ioa) {
+       if (ipr_is_ioa(dev)) {
                if (!scsi_dev_data->online)
                        sprintf(buf, "Offline");
                else if (ioa->ioa_dead)
@@ -13452,7 +13468,7 @@
                if (res_path) {
                        if (ioa->sis64)
                                if (serial_num == 1) {
-                                       if (scsi_dev_data && 
scsi_dev_data->type == IPR_TYPE_ADAPTER)
+                                       if (ipr_is_ioa(dev))
                                                loc_len = sprintf(body + len, 
"%s/%-28d", ioa->pci_address, ioa->host_num);
                                        else {
                                                
ipr_format_res_path(dev->res_path[ra].res_path_bytes, res_path_name, 
IPR_MAX_RES_PATH_LEN);
@@ -13467,7 +13483,7 @@
                                        scsi_dev_data->res_path : "<unknown>");
                        else /*32bit*/
                                if (serial_num == 1) {
-                                       if (scsi_dev_data && 
scsi_dev_data->type == IPR_TYPE_ADAPTER)
+                                       if (ipr_is_ioa(dev))
                                                loc_len = sprintf(body + len, 
"%s/%-29d:", ioa->pci_address, ioa->host_num);
                                        else
                                                loc_len = sprintf(body + len, 
"%s/%d", ioa->pci_address, ioa->host_num);
@@ -13486,7 +13502,7 @@
                }
        }
 
-       if (scsi_dev_data && scsi_dev_data->type == IPR_TYPE_ADAPTER && dev == 
&ioa->ioa) {
+       if (ipr_is_ioa(dev)) {
                if (serial_num == 1 ) {
                        if (!res_path || !ioa->sis64) {
                                for (i = 0; i < 28-loc_len; i++)
@@ -14628,7 +14644,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa != dev) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "Device is not an IOA\n");
                return -EINVAL;
        }
@@ -14676,7 +14692,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa != dev) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "Device is not an IOA\n");
                return -EINVAL;
        }
@@ -15406,7 +15422,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa != dev) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "Device is not an IOA\n");
                return -EINVAL;
        }
@@ -15705,7 +15721,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa == dev)
+       if (ipr_is_ioa(dev))
                return update_ioa_ucode(dev->ioa, args[1]);
        else
                return update_dev_ucode(dev, args[1]);
@@ -15729,7 +15745,7 @@
 
        for_each_ioa(ioa) {
                if (!ioa->ioa.scsi_dev_data)
-                       return;
+                       continue;
                for_each_dev(ioa, dev) {
                        if (ipr_is_volume_set(dev))
                                continue;
@@ -15738,7 +15754,7 @@
                        if (!lfw || lfw->version <= get_fw_version(dev))
                                continue;
 
-                       if (&dev->ioa->ioa == dev)
+                       if (ipr_is_ioa(dev))
                                rc = update_ioa_ucode(dev->ioa, lfw->file);
                        else
                                rc = update_dev_ucode(dev, lfw->file);
@@ -15997,7 +16013,7 @@
 
        printf("%s\n%s\n", status_hdr[2], status_sep[2]);
 
-       if (&dev->ioa->ioa == dev)
+       if (ipr_is_ioa(dev))
                printf_ioa_path_status(dev->ioa);
        else
                printf_path_status(dev);
@@ -16428,7 +16444,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa != dev) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "Device is not an IOA\n");
                return -EINVAL;
        }
@@ -16545,7 +16561,7 @@
                return -EINVAL;
        }
 
-       if (&dev->ioa->ioa == dev)
+       if (ipr_is_ioa(dev))
                printf("%08X\n", get_fw_version(dev));
        else {
                level = get_fw_version(dev);
@@ -16905,7 +16921,8 @@
        }
 
        if (!dev->array_rcd->migrate_cand) {
-               scsi_err(dev, "%s is not a candidate for array migration.\n");
+               scsi_err(dev, "%s is not a candidate for array migration.\n",
+                        args[0]);
                return -EINVAL;
        }
 
@@ -17125,7 +17142,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -17224,9 +17241,7 @@
 {
        char *body = NULL;
 
-       if (dev->scsi_dev_data &&
-           dev->scsi_dev_data->type == IPR_TYPE_ADAPTER &&
-           dev == &dev->ioa->ioa)
+       if (ipr_is_ioa(dev))
                body = ioa_details(body, dev);
        else if (ipr_is_volume_set(dev) || ipr_is_array(dev))
                body = vset_array_details(body, dev);
@@ -17693,7 +17708,7 @@
                fprintf(stderr, "Cannot find %s\n", dev_name);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", dev_name);
                return -EINVAL;
        }
@@ -18048,7 +18063,7 @@
        get_drive_phy_loc(dev->ioa);
 
        if (!ipr_is_volume_set(dev)){
-               if (&dev->ioa->ioa == dev)
+               if (ipr_is_ioa(dev))
                        fprintf(stdout, "%s\n", dev->ioa->physical_location);
                else
                        fprintf(stdout, "%s\n", dev->physical_location);
@@ -18086,7 +18101,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18133,7 +18148,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18184,7 +18199,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18243,7 +18258,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18280,7 +18295,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18344,7 +18359,7 @@
                fprintf(stderr, "Cannot find %s\n", args[0]);
                return -EINVAL;
        }
-       if (dev != &dev->ioa->ioa) {
+       if (!ipr_is_ioa(dev)) {
                fprintf(stderr, "%s is not an IOA.\n", args[0]);
                return -EINVAL;
        }
@@ -18645,7 +18660,7 @@
                input = temp_i_con->field_data;
 
                if (strcmp(input, "3") == 0) {
-                               if (ses->scsi_dev_data && 
ses->scsi_dev_data->type == IPR_TYPE_ADAPTER && ses == &ses->ioa->ioa) 
+                       if (ipr_is_ioa(ses))
                                return RC_89_Invalid_Dev_For_Resume;
 
                        if (ses->active_suspend == IOA_DEV_PORT_UNKNOWN)        
@@ -18657,7 +18672,7 @@
                        ses->is_resume_cand = 1;
                        resume_flag = 1;
                } else if (strcmp(input, "2") == 0) {
-                               if (ses->scsi_dev_data && 
ses->scsi_dev_data->type == IPR_TYPE_ADAPTER && ses == &ses->ioa->ioa) 
+                               if (ipr_is_ioa(ses))
                                        return RC_88_Invalid_Dev_For_Suspend;
 
                                if (ses->active_suspend == 
IOA_DEV_PORT_UNKNOWN)        
@@ -18774,7 +18789,7 @@
        ses = find_dev(args[0]);
        get_ses_ioport_status(ses);
 
-       if (ses->scsi_dev_data && ses->scsi_dev_data->type == IPR_TYPE_ADAPTER 
&& ses == &ses->ioa->ioa)  {
+       if (ipr_is_ioa(ses))  {
                fprintf(stderr,"Incorrect device type specified. Please specify 
a valid SAS device to suspend.\n");
                return 1;
        }
@@ -18827,7 +18842,7 @@
        ses = find_dev(args[0]);
        get_ses_ioport_status(ses);
 
-       if (ses->scsi_dev_data && ses->scsi_dev_data->type == IPR_TYPE_ADAPTER 
&& ses == &ses->ioa->ioa) {
+       if (ipr_is_ioa(ses)) {
                fprintf(stderr,"Incorrect device type specified. Please specify 
a valid SAS device to resume.\n");
                return 1;
        }
@@ -19032,6 +19047,9 @@
 
        printf("\n === Running show-details ===\n");
        for_each_ioa(ioa){
+               printf("IOA %s:\n", ioa->ioa.gen_name);
+               show_dev_details(&ioa->ioa);
+
                for_each_dev(ioa, dev){
                        printf("Device %s:\n", dev->gen_name);
                        show_dev_details(dev);
@@ -19416,25 +19434,6 @@
        return -EINVAL;
 }
 
-int check_sg_module()
-{
-       DIR *sg_dirfd;
-       char devpath[PATH_MAX];
-
-       sprintf(devpath, "%s", "/sys/module/sg");
-
-       sg_dirfd = opendir(devpath);
-
-       if (!sg_dirfd) {
-               syslog_dbg("Failed to open sg parameter.\n");
-               return -1;
-       }
-
-       closedir(sg_dirfd);
-
-       return 0;
-}
-
 void list_options()
 {
        int i;
@@ -19456,6 +19455,7 @@
        char parm_editor[200], parm_dir[200], cmd[200];
        int non_intenactive = 0;
 
+       tool_init_retry = 0;
        strcpy(parm_dir, DEFAULT_LOG_DIR);
        strcpy(parm_editor, DEFAULT_EDITOR);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/iprinit.c 
new/iprutils-rel-2-4-14/iprinit.c
--- old/iprutils-rel-2-4-13/iprinit.c   2016-08-16 16:47:13.000000000 +0200
+++ new/iprutils-rel-2-4-14/iprinit.c   2016-10-25 22:57:44.000000000 +0200
@@ -27,7 +27,7 @@
 
 char *tool_name = "iprinit";
 
-static void init_all()
+static int init_all()
 {
        struct ipr_ioa *ioa;
        int rc = tool_init(1);
@@ -39,8 +39,12 @@
                        syslog(LOG_ERR, "Error initializing adapters. Perhaps 
run with sudo?\n");
        }
        check_current_config(false);
-       for_each_ioa(ioa)
+       for_each_ioa(ioa) {
+               if (!strlen(ioa->ioa.gen_name))
+                       rc |= -EAGAIN;
                ipr_init_ioa(ioa);
+       }
+       return rc;
 }
 
 static void kevent_handler(char *buf)
@@ -65,7 +69,7 @@
 
 int main(int argc, char *argv[])
 {
-       int i;
+       int i, rc, delay_secs, wait;
 
        ipr_sg_required = 1;
 
@@ -81,12 +85,40 @@
                }
        }
 
-       init_all();
+       rc = check_sg_module();
 
        if (daemonize) {
                ipr_daemonize();
+
+               if (!rc)
+                       rc = init_all();
+
+               if (rc) {
+                       syslog(LOG_INFO, "Waiting for ipr adapters and sg 
module to come ready.\n");
+
+                       delay_secs = 2;
+                       sleep(delay_secs);
+
+                       for (wait = 0; rc && wait < 300; wait += delay_secs) {
+                               rc = check_sg_module();
+                               sleep(delay_secs);
+                               if (!rc)
+                                       rc = init_all();
+                       }
+
+                       if (rc)
+                               syslog(LOG_ERR, "Timeout reached. Ensure the sg 
module is loaded, then "
+                                      "run iprinit manually to ensure all "
+                                      "ipr RAID adapters are running 
optimally\n");
+               }
                return handle_events(poll_ioas, 60, kevent_handler);
-       }
+       } else if (!rc)
+               rc = init_all();
+
+       if (rc)
+               syslog(LOG_ERR, "iprinit failed. Ensure the sg module is 
loaded, then "
+                      "run iprinit again to ensure all "
+                      "ipr RAID adapters are running optimally\n");
 
-       return 0;
+       return rc;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/iprlib.c 
new/iprutils-rel-2-4-14/iprlib.c
--- old/iprutils-rel-2-4-13/iprlib.c    2016-08-16 16:47:13.000000000 +0200
+++ new/iprutils-rel-2-4-14/iprlib.c    2016-10-25 22:57:44.000000000 +0200
@@ -35,6 +35,7 @@
 int format_done = 0;
 static int ipr_mode5_write_buffer = 0;
 static int first_time_check_zeroed_dev = 0;
+int tool_init_retry = 1;
 
 struct sysfs_dev *head_zdev = NULL;
 struct sysfs_dev *tail_zdev = NULL;
@@ -569,8 +570,11 @@
                return NULL;
 
        for (sdev = head; sdev; sdev = sdev->next) {
-               if (sdev->device_id == dev->scsi_dev_data->device_id)
+               if (sdev->device_id != dev->scsi_dev_data->device_id)
+                       continue;
+               if (!memcmp(sdev->ioa_pci_addr, dev->ioa->pci_address, 
sizeof(sdev->ioa_pci_addr)))
                        break;
+
        }
 
        return sdev;
@@ -589,6 +593,9 @@
        struct ipr_ioa *ioa;
 
        for_each_ioa(ioa) {
+               if (memcmp(sdev->ioa_pci_addr, ioa->pci_address, 
sizeof(sdev->ioa_pci_addr)))
+                       continue;
+
                for_each_dev(ioa, dev) {
                        if (!dev->scsi_dev_data)
                                continue;
@@ -646,6 +653,7 @@
        if (!sdev) {
                sdev = calloc(1, sizeof(struct sysfs_dev));
                sdev->device_id = dev->scsi_dev_data->device_id;
+               memcpy(sdev->ioa_pci_addr, dev->ioa->pci_address, 
sizeof(sdev->ioa_pci_addr));
 
                if (!(*head)) {
                        *tail = *head = sdev;
@@ -2213,7 +2221,7 @@
 
        for (i = 0; i < 4 && rc_err == -EAGAIN; i++) {
                rc_err = __tool_init(save_state);
-               if (rc_err == -EAGAIN)
+               if (rc_err == -EAGAIN && tool_init_retry)
                        sleep(2);
        }
        if (rc_err) {
@@ -6181,13 +6189,14 @@
                                                     + 
mode_pages.hdr.block_desc_len +
                                                     sizeof(mode_pages.hdr));
                ioa->rebuild_rate = page24->rebuild_rate;
-               if (ioa_cap.dual_ioa_raid || 
ioa_cap.dual_ioa_asymmetric_access) {
-                       if (ioa_cap.disable_array_rebuild_verify) {
-                               ioa->configure_rebuild_verify = 1;
-                               ioa->disable_rebuild_verify =
-                                       page24->rebuild_without_verify;
-                       }
 
+               if (ioa_cap.disable_array_rebuild_verify) {
+                       ioa->configure_rebuild_verify = 1;
+                       ioa->disable_rebuild_verify =
+                               page24->rebuild_without_verify;
+               }
+
+               if (ioa_cap.dual_ioa_raid || 
ioa_cap.dual_ioa_asymmetric_access) {
                        if (ioa_cap.dual_ioa_raid && page24->dual_adapter_af == 
ENABLE_DUAL_IOA_AF)
                                ioa->dual_raid_support = 1;
 
@@ -6564,8 +6573,8 @@
        int *qac_entry_ref;
        struct ipr_dev_identify_vpd di_vpd;
        char *pchr;
-        struct ipr_mode_pages mode_pages;
-        struct ipr_ioa_mode_page *page;
+       struct ipr_mode_pages mode_pages;
+       struct ipr_ioa_mode_page *page;
 
        if (ipr_qac_data == NULL) {
                ipr_qac_data =
@@ -6619,9 +6628,12 @@
                        if (scsi_dev_data->host != ioa->host_num)
                                continue;
 
+                       if (ioa->ioa.scsi_dev_data == scsi_dev_data)
+                               continue;
+
                        if (scsi_dev_data->type == TYPE_DISK ||
                            scsi_dev_data->type == IPR_TYPE_AF_DISK ||
-                           scsi_dev_data->type == IPR_TYPE_ADAPTER ||
+                           scsi_dev_data->type == IPR_TYPE_ARRAY ||
                            scsi_dev_data->type == TYPE_ENCLOSURE ||
                            scsi_dev_data->type == TYPE_ROM ||
                            scsi_dev_data->type == TYPE_TAPE ||
@@ -6695,9 +6707,6 @@
                                        
__ipr_test_unit_ready(&ioa->dev[device_count], &sense_data);
 
                                device_count++;
-                       } else if (scsi_dev_data->type == IPR_TYPE_ADAPTER) {
-                               ioa->ioa.ioa = ioa;
-                               ioa->ioa.scsi_dev_data = scsi_dev_data;
                        }
                }
 
@@ -7206,6 +7215,15 @@
                        dev->scsi_dev_data->device_id);
 
                rc = ipr_get_saved_attr(dev->ioa, category, field, value);
+
+               if (rc) {
+                       /* Older kernels reported a byte swapped device_id, 
which has since
+                        been changed. Check both for compatibility reasons */
+                       sprintf(category,"[%s %lx]", IPR_CATEGORY_DEVICE,
+                               htobe64(dev->scsi_dev_data->device_id));
+
+                       rc = ipr_get_saved_attr(dev->ioa, category, field, 
value);
+               }
        }
 
        if (rc) {
@@ -7751,6 +7769,13 @@
        if (ipr_get_ioa_attr(ioa, &old_attr))
                return -EIO;
 
+       if (ioa->has_vset_write_cache && attr->vset_write_cache) {
+               /* vset cache should not be disabled adapter-wide
+                for any reason.  So we don't save the parameter here. */
+               ipr_change_cache_parameters(ioa,
+                                           IPR_IOA_SET_VSET_CACHE_ENABLED);
+       }
+
        /* FIXME - preferred_primary and active_active may change at the same
         * time.  This code may need to change.
         */
@@ -7823,14 +7848,6 @@
                }
        }
 
-       if (ioa->has_vset_write_cache && attr->vset_write_cache &&
-           power_cur_mode != POWER_BAREMETAL) {
-               /* vset cache should not be disabled adapter-wide
-                  for any reason.  So we don't save the parameter here. */
-               ipr_change_cache_parameters(ioa,
-                                           IPR_IOA_SET_VSET_CACHE_ENABLED);
-       }
-
        get_dual_ioa_state(ioa);        /* for preferred_primary */
        get_subsys_config(ioa);         /* for gscsi_only_ha */
        return 0;
@@ -8569,7 +8586,7 @@
                return 0;
        }
 
-       if (&dev->ioa->ioa == dev)
+       if (ipr_is_ioa(dev))
                return get_ioa_fw_version(dev->ioa);
 
        return get_dev_fw_version(dev);
@@ -8922,7 +8939,7 @@
        if (!dev)
                return NULL;
 
-       if (dev->scsi_dev_data->type == IPR_TYPE_ADAPTER)
+       if (ipr_is_ioa(dev))
                get_ioa_firmware_image_list(dev->ioa, &fw);
        else if (ipr_is_ses(dev))
                get_ses_firmware_image_list(dev, &fw);
@@ -8952,7 +8969,7 @@
        if (!dev)
                return -ENODEV;
 
-       if (dev->scsi_dev_data->type == IPR_TYPE_ADAPTER)
+       if (ipr_is_ioa(dev))
                get_ioa_firmware_image_list(dev->ioa, &fw);
        else if (ipr_is_ses(dev))
                get_ses_firmware_image_list(dev, &fw);
@@ -9292,6 +9309,37 @@
        return rc;
 }
 
+
+int ipr_ses_get_time(struct ipr_dev *dev, u64* timestamp, int *origin)
+{
+       struct ipr_ses_diag_page12 get_time;
+       int err;
+
+       err = ipr_receive_diagnostics(dev, 0x12, &get_time, sizeof(get_time));
+       if (err)
+               return -EIO;
+
+       *origin = !!get_time.timestamp_origin;
+       *timestamp = be64toh(*((u64*) get_time.timestamp)) >> 16;
+       return 0;
+}
+
+int ipr_ses_set_time(struct ipr_dev *dev, u64 timestamp)
+{
+       struct ipr_ses_diag_ctrl_page13 set_time;
+
+       memset(&set_time, '\0', sizeof(set_time));
+
+       set_time.page_code = 0x13;
+       set_time.page_length[1] = 8;
+
+       timestamp = htobe64(timestamp << 16);
+       memcpy(set_time.timestamp, (char*) &
+              timestamp, 6);
+
+       return ipr_send_diagnostics(dev, &set_time, sizeof(set_time));
+}
+
 /**
  * setup_page0x00 - 
  * @dev:               ipr dev struct
@@ -9545,7 +9593,6 @@
                        devs_cnt++;
                        if (temp->block_dev_class & IPR_SSD)
                                ssd_devs_cnt++;
-                       fprintf(stdout, "%s\n", temp->gen_name);
                }
        } else {
                devs_cnt++;
@@ -9597,6 +9644,17 @@
        if (polling_mode && !dev->should_init)
                return;
 
+       if (dev->ioa->has_vset_write_cache) {
+               int pol;
+               rc = ipr_get_saved_dev_attr(dev, IPR_WRITE_CACHE_POLICY,
+                                           saved_cache);
+
+               pol = (rc || strtoul (saved_cache, NULL, 10)) ?
+                       IPR_DEV_CACHE_WRITE_BACK : IPR_DEV_CACHE_WRITE_THROUGH;
+
+               ipr_set_dev_wcache_policy(dev, pol);
+       }
+
        if (!ipr_query_resource_state(dev, &res_state)) {
                ipr_count_devices_in_vset(dev, &num_devs, &ssd_num_devs);
                depth = ipr_max_queue_depth(dev->ioa, num_devs, ssd_num_devs);
@@ -9606,8 +9664,6 @@
                        return;
                rc = ipr_get_saved_dev_attr(dev, IPR_QUEUE_DEPTH, saved_depth);
                if (rc == RC_SUCCESS) {
-                       if (!strcmp(saved_depth, q_depth))
-                               return;
                        depth = strtoul(saved_depth, NULL, 10);
                        if (depth && depth <= 255)
                                strcpy(q_depth, saved_depth);
@@ -9618,18 +9674,6 @@
                if (ipr_write_dev_attr(dev, "queue_depth", q_depth))
                        return;
        }
-
-       if (dev->ioa->has_vset_write_cache) {
-               int pol;
-               rc = ipr_get_saved_dev_attr(dev, IPR_WRITE_CACHE_POLICY,
-                                           saved_cache);
-
-               pol = (rc || strtoul (saved_cache, NULL, 10)) ?
-                       IPR_DEV_CACHE_WRITE_BACK : IPR_DEV_CACHE_WRITE_THROUGH;
-
-               ipr_set_dev_wcache_policy(dev, pol);
-
-       }
 }
 
 /**
@@ -9801,7 +9845,7 @@
                init_af_dev(dev);
                break;
        case IPR_TYPE_ADAPTER:
-               if (&dev->ioa->ioa == dev)
+               if (ipr_is_ioa(dev))
                        init_ioa_dev(dev);
                break;
        case TYPE_ENCLOSURE:
@@ -9833,7 +9877,7 @@
                wait_for_dev(dev->dev_name);
                break;
        case IPR_TYPE_ADAPTER:
-               if (&dev->ioa->ioa != dev)
+               if (!ipr_is_ioa(dev))
                        break;
        case IPR_TYPE_AF_DISK:
                wait_for_dev(dev->gen_name);
@@ -10324,32 +10368,21 @@
        return 0;
 }
 
-int ipr_ses_get_time(struct ipr_dev *dev, u64* timestamp, int *origin)
+int check_sg_module()
 {
-       struct ipr_ses_diag_page12 get_time;
-       int err;
-
-       err = ipr_receive_diagnostics(dev, 0x12, &get_time, sizeof(get_time));
-       if (err)
-               return -EIO;
-
-       *origin = !!get_time.timestamp_origin;
-       *timestamp = be64toh(*((u64*) get_time.timestamp)) >> 16;
-       return 0;
-}
+       DIR *sg_dirfd;
+       char devpath[PATH_MAX];
 
-int ipr_ses_set_time(struct ipr_dev *dev, u64 timestamp)
-{
-       struct ipr_ses_diag_ctrl_page13 set_time;
+       sprintf(devpath, "%s", "/sys/module/sg");
 
-       memset(&set_time, '\0', sizeof(set_time));
+       sg_dirfd = opendir(devpath);
 
-       set_time.page_code = 0x13;
-       set_time.page_length[1] = 8;
+       if (!sg_dirfd) {
+               syslog_dbg("Failed to open sg parameter.\n");
+               return -1;
+       }
 
-       timestamp = htobe64(timestamp << 16);
-       memcpy(set_time.timestamp, (char*) &
-              timestamp, 6);
+       closedir(sg_dirfd);
 
-       return ipr_send_diagnostics(dev, &set_time, sizeof(set_time));
+       return 0;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/iprlib.h 
new/iprutils-rel-2-4-14/iprlib.h
--- old/iprutils-rel-2-4-13/iprlib.h    2016-08-16 16:47:13.000000000 +0200
+++ new/iprutils-rel-2-4-14/iprlib.h    2016-10-25 22:57:44.000000000 +0200
@@ -203,6 +203,7 @@
 #define IPR_XLATE_DEV_FMT_RC(rc)       ((((rc) & 127) == 51) ? -EIO : 0)
 #define IPR_TYPE_AF_DISK                     0xC
 #define IPR_TYPE_ADAPTER                     0x1f
+#define IPR_TYPE_ARRAY                            0x1f
 #define IPR_TYPE_EMPTY_SLOT                  0xff
 
 #define IPR_ACTIVE_OPTIMIZED                 0x0
@@ -295,9 +296,11 @@
 extern struct sysfs_dev *head_zdev;
 extern struct sysfs_dev *tail_zdev;
 extern enum system_p_mode power_cur_mode;
+extern int tool_init_retry;
 
 struct sysfs_dev {
        u64 device_id;
+       char ioa_pci_addr[16];
        struct sysfs_dev *next, *prev;
 };
 
@@ -2955,6 +2958,11 @@
 int ipr_known_zeroed_is_saved(struct ipr_dev *);
 int get_sg_name(struct scsi_dev_data *);
 int ipr_sg_inquiry(struct scsi_dev_data *, u8, void *, u8);
+int get_scsi_dev_data(struct scsi_dev_data **scsi_dev_ref);
+
+int ipr_device_lock(struct ipr_dev *dev);
+void ipr_device_unlock(struct ipr_dev *dev);
+int check_sg_module();
 
 static inline u32 ipr_get_dev_res_handle(struct ipr_ioa *ioa, struct 
ipr_dev_record *dev_rcd)
 {
@@ -2997,6 +3005,15 @@
                return 1;
        else
                return 0;
+}
+
+static inline int ipr_is_ioa(struct ipr_dev *device)
+{
+       if (device->ioa && device->ioa->ioa.scsi_dev_data &&
+           device->scsi_dev_data == device->ioa->ioa.scsi_dev_data)
+               return 1;
+       else
+               return 0;
 }
 
 static inline int ipr_is_af_dasd_device(struct ipr_dev *device)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/iprutils-rel-2-4-13/spec/iprutils.spec 
new/iprutils-rel-2-4-14/spec/iprutils.spec
--- old/iprutils-rel-2-4-13/spec/iprutils.spec  2016-08-16 16:47:13.000000000 
+0200
+++ new/iprutils-rel-2-4-14/spec/iprutils.spec  2016-10-25 22:57:44.000000000 
+0200
@@ -1,6 +1,6 @@
 Summary: Utilities for the IBM Power Linux RAID adapters
 Name: iprutils
-Version: 2.4.13
+Version: 2.4.14
 # For RC releases, release_prefix should be set to 0.rc1, 0.rc2, etc.
 # For GA releases, release_prefix should be set to 1, 2, 3, etc.
 %define release_prefix 1
@@ -322,6 +322,21 @@
 %endif #WITH_STATIC
 
 %changelog
+* Tue Oct 25 2016 Brian King <[email protected]> 2.4.14
+- Released iprutils 2.4.14
+* Wed Oct 19 2016 Brian King <[email protected]>
+- Remove sleeps from iprconfig initialization
+- Filter out JBOD HDDs from the device statistics menu
+* Wed Oct 05 2016 Brian King <[email protected]>
+- Allow VSET write cache in bare metal mode
+* Tue Oct 04 2016 Brian King <[email protected]>
+- Fix raid-create on dual adapter setups
+- Wait for sg module
+- Disable rebuild verify by default for single adapter configurations
+- Remove stale debug printf
+- Vset cache enable fixes
+- Backwards compatibility for endian swapped device_id
+- Fix iprconfig dump option to log full IOA details
 * Tue Aug 16 2016 Brian King <[email protected]> 2.4.13
 - Additional fixes for tracking known zeroed state
 * Thu Aug 04 2016 Brian King <[email protected]> 2.4.12


Reply via email to