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@xxxxxxxxxxxxxxxxxx> --- 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; _ - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html