After reset completed, the scsi error handler sends out TEST_UNIT_READY to the device. For 'normal' devices this command will be handled by firmware. However, because the RAID console only interfaces to scsi mid layer, the firmware will not process this command for it. This will make the console to be offlined right after reset. Add the handling in driver to fix this problem. Signed-off-by: Ed Lin --- diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 4c6ce6a..85c779b 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -601,6 +601,13 @@ stex_queuecommand(struct scsi_cmnd *cmd, stex_invalid_field(cmd, done); return 0; } + case TEST_UNIT_READY: + if (id == host->max_id - 1) { + cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; + done(cmd); + return 0; + } + break; case INQUIRY: if (id != host->max_id - 1) break;