All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi: Add EH Start Unit retry
@ 2007-03-29 20:25 Brian King
  0 siblings, 0 replies; 7+ messages in thread
From: Brian King @ 2007-03-29 20:25 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, thlin, brking


Currently, the scsi error handler will issue a START_UNIT
command if the drive indicates it needs its motor started
and the allow_restart flag is set in the scsi_device. If,
after the scsi error handler invokes a host adapter reset
due to error recovery, a device is in a unit attention
state AND also needs a START_UNIT, that device will be placed
offline. The disk array devices on an ipr RAID adapter
will do exactly this when in a dual initiator configuration.
This patch adds a single retry to the EH initiated
START_UNIT.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 linux-2.6-bjking1/drivers/scsi/scsi_error.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/scsi_error.c~scsi_eh_stu_retry drivers/scsi/scsi_error.c
--- linux-2.6/drivers/scsi/scsi_error.c~scsi_eh_stu_retry	2007-03-14 15:04:17.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/scsi_error.c	2007-03-14 15:04:17.000000000 -0500
@@ -923,12 +923,22 @@ static int scsi_eh_try_stu(struct scsi_c
 	static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
 
 	if (scmd->device->allow_restart) {
-		int rtn;
+		int retry_cnt = 1, rtn;
 
+retry_stu:
 		rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
 					START_UNIT_TIMEOUT, 0);
-		if (rtn == SUCCESS)
+
+		switch (rtn) {
+		case SUCCESS:
 			return 0;
+		case NEEDS_RETRY:
+			if (retry_cnt--)
+				goto retry_stu;
+			/*FALLTHRU*/
+		default:
+			return 1;
+		}
 	}
 
 	return 1;
_

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-03 13:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <11751999513070-patch-mail.ibm.com>
2007-03-29 22:02 ` [PATCH 1/1] scsi: Add EH Start Unit retry Douglas Gilbert
2007-04-02 18:57   ` Brian King
2007-04-03  3:09     ` James Bottomley
2007-04-03 13:20       ` Brian King
2007-04-01 16:36 ` James Bottomley
2007-04-02 13:38   ` Brian King
2007-03-29 20:25 Brian King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.