All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] stex: fix reset recovery for console device
@ 2007-05-10  4:50 Ed Lin
  2007-05-10 21:04 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Ed Lin @ 2007-05-10  4:50 UTC (permalink / raw)
  To: linux-scsi; +Cc: james.Bottomley, jeff, promise_linux


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>
---
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 81dd3b7..47c2ef9 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -612,6 +612,13 @@ stex_queuecommand(struct scsi_cmnd *cmd,
 			return 0;
 		}
 		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:
 		if (id != host->max_id - 1)
 			break;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/4] stex: fix reset recovery for console device
  2007-05-10  4:50 [PATCH 3/4] stex: fix reset recovery for console device Ed Lin
@ 2007-05-10 21:04 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-05-10 21:04 UTC (permalink / raw)
  To: Ed Lin; +Cc: linux-scsi, james.Bottomley, promise_linux

Ed Lin wrote:
> 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>
> ---
> diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
> index 81dd3b7..47c2ef9 100644
> --- a/drivers/scsi/stex.c
> +++ b/drivers/scsi/stex.c
> @@ -612,6 +612,13 @@ stex_queuecommand(struct scsi_cmnd *cmd,
>  			return 0;
>  		}
>  		break;
> +	case TEST_UNIT_READY:
> +		if (id == host->max_id - 1) {
> +			cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
> +			done(cmd);
> +			return 0;
> +		}
> +		break;

Long term, it seems like a more obvious separation between the RAID 
console and the firmware-handled devices would be useful, rather than 
repeating the "if (id == host->max_id - 1)" for each command in question.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-10 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10  4:50 [PATCH 3/4] stex: fix reset recovery for console device Ed Lin
2007-05-10 21:04 ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.