Skip to content

Commit 7ff723a

Browse files
suganathprabu0512martinkpetersen
authored andcommitted
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>
1 parent 7630b3a commit 7ff723a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/scsi/mpt3sas/mpt3sas_scsih.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3885,6 +3885,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
38853885
}
38863886
}
38873887

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+
38883893
/**
38893894
* _scsih_flush_running_cmds - completing outstanding commands.
38903895
* @ioc: per adapter object
@@ -3906,6 +3911,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
39063911
if (!scmd)
39073912
continue;
39083913
count++;
3914+
if (ata_12_16_cmd(scmd))
3915+
scsi_internal_device_unblock(scmd->device,
3916+
SDEV_RUNNING);
39093917
mpt3sas_base_free_smid(ioc, smid);
39103918
scsi_dma_unmap(scmd);
39113919
if (ioc->pci_error_recovery)
@@ -4010,11 +4018,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
40104018
SAM_STAT_CHECK_CONDITION;
40114019
}
40124020

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-
40184021
/**
40194022
* scsih_qcmd - main scsi request entry point
40204023
* @scmd: pointer to scsi command object

0 commit comments

Comments
 (0)