]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mpt2sas, mpt3sas: Fail the host reset initiated due to discovery related I/O timeouts...
authorSreekanth Reddy <sreekanth.reddy@avagotech.com>
Mon, 12 Jan 2015 06:08:57 +0000 (11:38 +0530)
committerChristoph Hellwig <hch@lst.de>
Tue, 13 Jan 2015 15:27:24 +0000 (16:27 +0100)
When a flaky disk is there in a topology then during driver load,
discovery related I/O times out; which results in SCSI error recovery
initiating host reset and then the controller won't see any disk.

In this patch, The driver would return FAILED status to the host reset
initiated due to discovery related I/O timeout if ioc->is_driver_loading
is set. This flag would be set until we exit out of scsih_scan_finished().
i.e.
During device discovery if one of the disk is flaky
(which responds to some discovery commands and doesn't respond to some)
the driver wouldn't perform host reset for discovery related I/O timeout.
Instead it would return Failure for the host reset resulting in the
flaky disk getting removed by the SCSI Mid layer,
so other disks would be added correctly.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/mpt2sas/mpt2sas_scsih.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c

index 7000815277b125e6ebe3f74b0c31cb361ada7909..a3140ed3cfe6f2645947b6b000c80eb37b08c217 100644 (file)
@@ -2729,9 +2729,18 @@ _scsih_host_reset(struct scsi_cmnd *scmd)
            ioc->name, scmd);
        scsi_print_command(scmd);
 
+       if (ioc->is_driver_loading) {
+               printk(MPT2SAS_INFO_FMT "Blocking the host reset\n",
+                                                         ioc->name);
+               r = FAILED;
+               goto out;
+       }
+
        retval = mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
            FORCE_BIG_HAMMER);
        r = (retval < 0) ? FAILED : SUCCESS;
+
+ out:
        printk(MPT2SAS_INFO_FMT "host reset: %s scmd(%p)\n",
            ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);
 
index c3c0b45df102217bec0e9dc761eed92f3a1d30a4..5aa2ee96d0e6c6721fc7f83b70611e308508c8d7 100644 (file)
@@ -2392,9 +2392,17 @@ _scsih_host_reset(struct scsi_cmnd *scmd)
            ioc->name, scmd);
        scsi_print_command(scmd);
 
+       if (ioc->is_driver_loading) {
+               pr_info(MPT3SAS_FMT "Blocking the host reset\n",
+                   ioc->name);
+               r = FAILED;
+               goto out;
+       }
+
        retval = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP,
            FORCE_BIG_HAMMER);
        r = (retval < 0) ? FAILED : SUCCESS;
+out:
        pr_info(MPT3SAS_FMT "host reset: %s scmd(%p)\n",
            ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd);