Skip to content

Commit 6eddf5c

Browse files
suganathprabu0512gregkh
authored andcommitted
scsi: mpt3sas: Unblock device after controller reset
commit 7ff723ad0f87feba43dda45fdae71206063dd7d4 upstream. 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] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c178e48 commit 6eddf5c

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
@@ -3706,6 +3706,11 @@ _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc,
37063706
}
37073707
}
37083708

3709+
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
3710+
{
3711+
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
3712+
}
3713+
37093714
/**
37103715
* _scsih_flush_running_cmds - completing outstanding commands.
37113716
* @ioc: per adapter object
@@ -3727,6 +3732,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
37273732
if (!scmd)
37283733
continue;
37293734
count++;
3735+
if (ata_12_16_cmd(scmd))
3736+
scsi_internal_device_unblock(scmd->device,
3737+
SDEV_RUNNING);
37303738
mpt3sas_base_free_smid(ioc, smid);
37313739
scsi_dma_unmap(scmd);
37323740
if (ioc->pci_error_recovery)
@@ -3831,11 +3839,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
38313839
SAM_STAT_CHECK_CONDITION;
38323840
}
38333841

3834-
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
3835-
{
3836-
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
3837-
}
3838-
38393842
/**
38403843
* scsih_qcmd - main scsi request entry point
38413844
* @scmd: pointer to scsi command object

0 commit comments

Comments
 (0)