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>
This commit is contained in:
parent
7630b3a599
commit
7ff723ad0f
|
@ -3885,6 +3885,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.
|
* _scsih_flush_running_cmds - completing outstanding commands.
|
||||||
* @ioc: per adapter object
|
* @ioc: per adapter object
|
||||||
|
@ -3906,6 +3911,9 @@ _scsih_flush_running_cmds(struct MPT3SAS_ADAPTER *ioc)
|
||||||
if (!scmd)
|
if (!scmd)
|
||||||
continue;
|
continue;
|
||||||
count++;
|
count++;
|
||||||
|
if (ata_12_16_cmd(scmd))
|
||||||
|
scsi_internal_device_unblock(scmd->device,
|
||||||
|
SDEV_RUNNING);
|
||||||
mpt3sas_base_free_smid(ioc, smid);
|
mpt3sas_base_free_smid(ioc, smid);
|
||||||
scsi_dma_unmap(scmd);
|
scsi_dma_unmap(scmd);
|
||||||
if (ioc->pci_error_recovery)
|
if (ioc->pci_error_recovery)
|
||||||
|
@ -4010,11 +4018,6 @@ _scsih_eedp_error_handling(struct scsi_cmnd *scmd, u16 ioc_status)
|
||||||
SAM_STAT_CHECK_CONDITION;
|
SAM_STAT_CHECK_CONDITION;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool ata_12_16_cmd(struct scsi_cmnd *scmd)
|
|
||||||
{
|
|
||||||
return (scmd->cmnd[0] == ATA_12 || scmd->cmnd[0] == ATA_16);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scsih_qcmd - main scsi request entry point
|
* scsih_qcmd - main scsi request entry point
|
||||||
* @scmd: pointer to scsi command object
|
* @scmd: pointer to scsi command object
|
||||||
|
|
Loading…
Reference in New Issue