aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2007-03-29 16:25:52 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-04-17 17:55:36 -0400
commited773e66480fdcd06732eb2aa39362599dcd67fa (patch)
tree53b0a88ea4557efaea19e83701437b11e2dee1ff /drivers/scsi/scsi_error.c
parent18a6598f2d3bb7275dadba77df5f06bc996a77d4 (diff)
[SCSI] scsi_error.c: Add EH Start Unit retry
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> Patch modified and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 7a1a1bb1341e..28a266c804be 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -932,10 +932,12 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
932 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0}; 932 static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};
933 933
934 if (scmd->device->allow_restart) { 934 if (scmd->device->allow_restart) {
935 int rtn; 935 int i, rtn = NEEDS_RETRY;
936
937 for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
938 rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
939 START_UNIT_TIMEOUT, 0);
936 940
937 rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
938 START_UNIT_TIMEOUT, 0);
939 if (rtn == SUCCESS) 941 if (rtn == SUCCESS)
940 return 0; 942 return 0;
941 } 943 }