Browse Source

[SCSI] stex: fix reset recovery for console device

After reset completed, the scsi error handler sends out TEST_UNIT_READY
to the device. For 'normal' devices the command will be handled by firmware.
However, because the RAID console only interfaces to scsi mid layer, the
firmware will not process the 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 <ed.lin@promise.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Ed Lin 18 years ago
parent
commit
d116a7bc6a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      drivers/scsi/stex.c

+ 7 - 0
drivers/scsi/stex.c

@@ -612,6 +612,13 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
 			return 0;
 			return 0;
 		}
 		}
 		break;
 		break;
+	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:
 	case INQUIRY:
 		if (id != host->max_id - 1)
 		if (id != host->max_id - 1)
 			break;
 			break;