From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
linux-scsi@vger.kernel.org,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@suse.com>
Subject: [PATCHv4 07/12] mpt3sas: check command status before attempting abort
Date: Wed, 22 Feb 2017 11:31:47 +0100 [thread overview]
Message-ID: <1487759512-3873-8-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1487759512-3873-1-git-send-email-hare@suse.de>
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index 6bc9291..1c45fb3 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -2261,6 +2261,14 @@ struct _sas_node *
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",
@@ -2268,9 +2276,6 @@ struct _sas_node *
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));
--
1.8.5.6
next prev parent reply other threads:[~2017-02-22 10:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 10:31 [PATCHv4 00/12] mpt3sas: lockless command submission Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 01/12] mpt3sas: switch to pci_alloc_irq_vectors Hannes Reinecke
2017-02-23 22:04 ` Martin K. Petersen
2017-02-22 10:31 ` [PATCHv4 02/12] mpt3sas: set default value for cb_idx Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 03/12] mpt3sas: use 'list_splice_init()' Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 04/12] mpt3sas: separate out _base_recovery_check() Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 05/12] mpt3sas: open-code _scsih_scsi_lookup_get() Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 06/12] mpt3sas: Introduce mpt3sas_get_st_from_smid() Hannes Reinecke
2017-02-22 10:31 ` Hannes Reinecke [this message]
2017-02-22 10:31 ` [PATCHv4 08/12] mpt3sas: always use first reserved smid for ioctl passthrough Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 09/12] mpt3sas: simplify task management functions Hannes Reinecke
2017-03-06 5:16 ` Sreekanth Reddy
2017-03-13 15:15 ` Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 10/12] mpt3sas: simplify mpt3sas_scsi_issue_tm() Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 11/12] mpt3sas: simplify _wait_for_commands_to_complete() Hannes Reinecke
2017-03-03 11:57 ` Sreekanth Reddy
2017-03-03 13:53 ` Hannes Reinecke
2017-02-22 10:31 ` [PATCHv4 12/12] mpt3sas: lockless command submission Hannes Reinecke
2017-03-03 12:32 ` Sreekanth Reddy
2017-03-03 13:59 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487759512-3873-8-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox