Skip to content

Commit

Permalink
[SCSI] scsi_error.c: Add EH Start Unit retry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brian King authored and James Bottomley committed Apr 17, 2007
1 parent 18a6598 commit ed773e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,10 +932,12 @@ static int scsi_eh_try_stu(struct scsi_cmnd *scmd)
static unsigned char stu_command[6] = {START_STOP, 0, 0, 0, 1, 0};

if (scmd->device->allow_restart) {
int rtn;
int i, rtn = NEEDS_RETRY;

for (i = 0; rtn == NEEDS_RETRY && i < 2; i++)
rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
START_UNIT_TIMEOUT, 0);

rtn = scsi_send_eh_cmnd(scmd, stu_command, 6,
START_UNIT_TIMEOUT, 0);
if (rtn == SUCCESS)
return 0;
}
Expand Down

0 comments on commit ed773e6

Please sign in to comment.