diff options
author | Hannes Reinecke <hare@suse.de> | 2018-01-04 13:57:06 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-01-11 05:25:01 +0100 |
commit | 9961c9bbf2b43acaaf030a0fbabc9954d937ad8c (patch) | |
tree | e07d711d0d403dd9159ee8a41504e6d8ac859046 /drivers/scsi/mpt3sas | |
parent | scsi: mpt3sas: Introduce mpt3sas_get_st_from_smid() (diff) | |
download | linux-9961c9bbf2b43acaaf030a0fbabc9954d937ad8c.tar.xz linux-9961c9bbf2b43acaaf030a0fbabc9954d937ad8c.zip |
scsi: mpt3sas: check command status before attempting abort
When attempting a command abort we should check the command status prior
to sending the abort; the command might've been completed already.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index a11774ba3ab8..8870ceffb0bb 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2771,6 +2771,14 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel, return (!rc) ? SUCCESS : FAILED; } + if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) { + scsi_lookup = mpt3sas_get_st_from_smid(ioc, smid_task); + if (!scsi_lookup) + return FAILED; + if (scsi_lookup->cb_idx == 0xFF) + return SUCCESS; + } + smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_cb_idx); if (!smid) { pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", @@ -2778,9 +2786,6 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel, return FAILED; } - if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK) - scsi_lookup = mpt3sas_get_st_from_smid(ioc, smid_task); - dtmprintk(ioc, pr_info(MPT3SAS_FMT "sending tm: handle(0x%04x), task_type(0x%02x), smid(%d)\n", ioc->name, handle, type, smid_task)); |