Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1559370

[PATCH 5/6] ncr5380: Improve target selection robustness

From Finn Thain <fthain@telegraphics.com.au>
Newsgroups linux.kernel
Subject [PATCH 5/6] ncr5380: Improve target selection robustness
Date 2017-01-16 01:00 +0100
Message-ID <t02Sm-xH-17@gated-at.bofh.it> (permalink)
References <t02Sl-xH-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Handle timeout or bus phase change errors that could occur when
sending the IDENTIFY message.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
---
 drivers/scsi/NCR5380.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 518d101..acc3344 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1165,8 +1165,16 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,
 	data = tmp;
 	phase = PHASE_MSGOUT;
 	NCR5380_transfer_pio(instance, &phase, &len, &data);
+	if (len) {
+		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
+		cmd->result = DID_ERROR << 16;
+		complete_cmd(instance, cmd);
+		dsprintk(NDEBUG_SELECTION, instance, "IDENTIFY message transfer failed\n");
+		cmd = NULL;
+		goto out;
+	}
+
 	dsprintk(NDEBUG_SELECTION, instance, "nexus established.\n");
-	/* XXX need to handle errors here */
 
 	hostdata->connected = cmd;
 	hostdata->busy[cmd->device->id] |= 1 << cmd->device->lun;
-- 
2.10.2

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 5/6] ncr5380: Improve target selection robustness Finn Thain <fthain@telegraphics.com.au> - 2017-01-16 01:00 +0100

csiph-web