mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 09/10] NCR5380: Handle BUS FREE during reselection
Date: Thu, 27 Sep 2018 11:17:11 +1000	[thread overview]
Message-ID: <2d3935168bd7345cb60aba5b3f08d45f6e6cc0eb.1538011031.git.fthain@telegraphics.com.au> (raw)
In-Reply-To: <cover.1538011031.git.fthain@telegraphics.com.au>

The X3T9.2 specification (draft) says, under "6.1.4.2 RESELECTION
time-out procedure", that a target may assert RST or go to BUS FREE
phase if the initiator does not respond within 200 us. Something
like this has been observed with AztecMonster II target. When it
happens, all we can do is wait for the target to try again.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
 drivers/scsi/NCR5380.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 419033643015..b9a3eb0647e4 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2047,6 +2047,9 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
 
 	if (NCR5380_poll_politely(hostdata,
 	                          STATUS_REG, SR_REQ, SR_REQ, 2 * HZ) < 0) {
+		if ((NCR5380_read(STATUS_REG) & (SR_BSY | SR_SEL)) == 0)
+			/* BUS FREE phase */
+			return;
 		shost_printk(KERN_ERR, instance, "reselect: REQ timeout\n");
 		do_abort(instance);
 		return;
-- 
2.16.4


  parent reply	other threads:[~2018-09-27  1:27 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 ` [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 02/10] NCR5380: Reduce goto statements in NCR5380_select() Finn Thain
2018-09-27  1:17 ` [PATCH 01/10] NCR5380: Clear all unissued commands on host reset Finn Thain
2018-09-27  1:17 ` [PATCH 10/10] NCR5380: Check for bus reset 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 07/10] NCR5380: Don't clear busy flag when abort fails 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 ` Finn Thain [this message]
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=2d3935168bd7345cb60aba5b3f08d45f6e6cc0eb.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

all inboxes | Powered by JetHome®