From: Finn Thain <fthain@telegraphics.com.au>
To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Michael Schmitz <schmitzmic@gmail.com>,
Hannes Reinecke <hare@suse.de>,
Ondrey Zary <linux@rainbow-software.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/10] NCR5380: Clear all unissued commands on host reset
Date: Thu, 27 Sep 2018 11:17:11 +1000 [thread overview]
Message-ID: <d811e76b0731e6fb320936c910b71b88bc0c1464.1538011031.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1538011031.git.fthain@telegraphics.com.au>
From: Hannes Reinecke <hare@suse.de>
When doing a host reset we should be clearing all outstanding
commands, not just the command triggering the reset.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Ondrey Zary <linux@rainbow-software.org>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
drivers/scsi/NCR5380.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 90ea0f5d9bdb..80c20ab4fc53 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2308,7 +2308,7 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)
spin_lock_irqsave(&hostdata->lock, flags);
#if (NDEBUG & NDEBUG_ANY)
- scmd_printk(KERN_INFO, cmd, __func__);
+ shost_printk(KERN_INFO, instance, __func__);
#endif
NCR5380_dprint(NDEBUG_ANY, instance);
NCR5380_dprint_phase(NDEBUG_ANY, instance);
@@ -2326,10 +2326,13 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)
* commands!
*/
- if (list_del_cmd(&hostdata->unissued, cmd)) {
+ list_for_each_entry(ncmd, &hostdata->unissued, list) {
+ struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
+
cmd->result = DID_RESET << 16;
cmd->scsi_done(cmd);
}
+ INIT_LIST_HEAD(&hostdata->unissued);
if (hostdata->selecting) {
hostdata->selecting->result = DID_RESET << 16;
--
2.16.4
next prev parent reply other threads:[~2018-09-27 1:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-27 1:17 [PATCH 00/10] NCR5380: Various improvements Finn Thain
2018-09-27 1:17 ` Finn Thain [this message]
2018-09-27 1:17 ` [PATCH 09/10] NCR5380: Handle BUS FREE during reselection Finn Thain
2018-09-27 1:17 ` [PATCH 08/10] NCR5380: Don't call dsprintk() following reselection interrupt Finn Thain
2018-09-27 1:17 ` [PATCH 06/10] NCR5380: Check for invalid reselection target Finn Thain
2018-09-27 1:17 ` [PATCH 04/10] NCR5380: Withhold disconnect privilege for REQUEST SENSE Finn Thain
2018-09-27 1:17 ` [PATCH 03/10] NCR5380: Have NCR5380_select() return a bool Finn Thain
2018-09-27 1:17 ` [PATCH 10/10] NCR5380: Check for bus reset Finn Thain
2018-09-27 1:17 ` [PATCH 05/10] NCR5380: Use DRIVER_SENSE to indicate valid sense data Finn Thain
2018-09-27 1:17 ` [PATCH 02/10] NCR5380: Reduce goto statements in NCR5380_select() Finn Thain
2018-09-27 1:17 ` [PATCH 07/10] NCR5380: Don't clear busy flag when abort fails Finn Thain
2018-09-28 6:29 ` [PATCH 00/10] NCR5380: Various improvements Martin K. Petersen
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=d811e76b0731e6fb320936c910b71b88bc0c1464.1538011031.git.fthain@telegraphics.com.au \
--to=fthain@telegraphics.com.au \
--cc=hare@suse.de \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@rainbow-software.org \
--cc=martin.petersen@oracle.com \
--cc=schmitzmic@gmail.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;
as well as URLs for NNTP newsgroup(s).