]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: mpt3sas: Unblock device after controller reset
authorSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Thu, 17 Nov 2016 10:45:58 +0000 (16:15 +0530)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:24:12 +0000 (13:24 -0800)
Orabug: 25639713

While issuing any ATA passthrough command to firmware the driver will
block the device. But it will unblock the device only if the I/O
completes through the ISR path. If a controller reset occurs before
command completion the device will remain in blocked state.

Make sure we unblock the device following a controller reset if an ATA
passthrough command was queued.

[mkp: clarified patch description]

Cc: <stable@vger.kernel.org> # v4.4+
Fixes: ac6c2a93bd07 ("mpt3sas: Fix for SATA drive in blocked state, after diag reset")
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 7ff723ad0f87feba43dda45fdae71206063dd7d4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/scsi/mpt3sas/mpt3sas_scsih.c

drivers/scsi/mpt3sas/mpt3sas_scsih.c

index c6f934d904aeea89305ab64347fe4c1a433d6e22..ee02aba0262f31e6c1c119962b840b0597a4d7d6 100644 (file)
@@ -3899,6 +3899,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
        }
 }
 
+static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
+{
+       return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
+}
+
 /**
  * _scsih_flush_running_cmds - completing outstanding commands.
  * @ioc: per adapter object
@@ -3920,6 +3925,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
                if (!scmd)
                        continue;
                count++;
+               if (ata_12_16_cmd(scmd))
+                       scsi_internal_device_unblock(scmd->device,
+                                                       SDEV_RUNNING);
                mpt3sas_base_free_smid(ioc, smid);
                scsi_dma_unmap(scmd);
                if (ioc->pci_error_recovery)