diff options
author | Suganath Prabu S <suganath-prabu.subramani@broadcom.com> | 2016-11-17 05:45:58 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-22 17:18:08 -0500 |
commit | 7ff723ad0f87feba43dda45fdae71206063dd7d4 (patch) | |
tree | 165f4b65384c511b91137628e4ac89cfac6ee705 | |
parent | 7630b3a599e2c6d1c042945d32ff2debc855ad29 (diff) |
scsi: mpt3sas: Unblock device after controller reset
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>
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 91b70bc46e7f..1c4744e78173 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
@@ -3885,6 +3885,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc, | |||
3885 | } | 3885 | } |
3886 | } | 3886 | } |
3887 | 3887 | ||
3888 | static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd) | ||
3889 | { | ||
3890 | return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16); | ||
3891 | } | ||
3892 | |||
3888 | /** | 3893 | /** |
3889 | * _scsih_flush_running_cmds - completing outstanding commands. | 3894 | * _scsih_flush_running_cmds - completing outstanding commands. |
3890 | * @ioc: per adapter object | 3895 | * @ioc: per adapter object |
@@ -3906,6 +3911,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc) | |||
3906 | if (!scmd) | 3911 | if (!scmd) |
3907 | continue; | 3912 | continue; |
3908 | count++; | 3913 | count++; |
3914 | if (ata_12_16_cmd(scmd)) | ||
3915 | scsi_internal_device_unblock(scmd->device, | ||
3916 | SDEV_RUNNING); | ||
3909 | mpt3sas_base_free_smid(ioc, smid); | 3917 | mpt3sas_base_free_smid(ioc, smid); |
3910 | scsi_dma_unmap(scmd); | 3918 | scsi_dma_unmap(scmd); |
3911 | if (ioc->pci_error_recovery) | 3919 | if (ioc->pci_error_recovery) |
@@ -4010,11 +4018,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status) | |||
4010 | SAM_STAT_CHECK_CONDITION; | 4018 | SAM_STAT_CHECK_CONDITION; |
4011 | } | 4019 | } |
4012 | 4020 | ||
4013 | static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd) | ||
4014 | { | ||
4015 | return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16); | ||
4016 | } | ||
4017 | |||
4018 | /** | 4021 | /** |
4019 | * scsih_qcmd - main scsi request entry point | 4022 | * scsih_qcmd - main scsi request entry point |
4020 | * @scmd: pointer to scsi command object | 4023 | * @scmd: pointer to scsi command object |