LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
@ 2007-03-30 22:21 Ed Lin
  2007-03-31 18:46 ` James Bottomley
  0 siblings, 1 reply; 6+ messages in thread
From: Ed Lin @ 2007-03-30 22:21 UTC (permalink / raw)
  To: linux-scsi; +Cc: linux-kernel, james.Bottomley, jeff, promise_linux

After reset completed, the scsi error handler sends out START_STOP
and TEST_UNIT_READY to the device. For 'normal' devices these
commands will be handled by firmware. However, because the RAID
console only interfaces to scsi mid layer, the firmware will not process
these commands 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 1e8d7ac..9465f35 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -605,6 +605,14 @@ stex_queuecommand(struct scsi_cmnd *cmd,
 			stex_invalid_field(cmd, done);
 		return 0;
 	}
+	case TEST_UNIT_READY:
+	case START_STOP:
+		if (id == ST_MAX_ARRAY_SUPPORTED) {
+			cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8;
+			done(cmd);
+			return 0;
+		}
+		break;
 	case INQUIRY:
 		if (id != ST_MAX_ARRAY_SUPPORTED)
 			break;



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

* Re: [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
  2007-03-30 22:21 [PATCH 3/4] [SCSI]stex: fix reset recovery for console device Ed Lin
@ 2007-03-31 18:46 ` James Bottomley
  0 siblings, 0 replies; 6+ messages in thread
From: James Bottomley @ 2007-03-31 18:46 UTC (permalink / raw)
  To: Ed Lin; +Cc: linux-scsi, linux-kernel, jeff, promise_linux

On Fri, 2007-03-30 at 15:21 -0700, Ed Lin wrote:
> After reset completed, the scsi error handler sends out START_STOP
> and TEST_UNIT_READY to the device. For 'normal' devices these
> commands will be handled by firmware. However, because the RAID
> console only interfaces to scsi mid layer, the firmware will not process
> these commands for it. This will make the console to be offlined right
> after reset. Add the handling in driver to fix this problem.

I don't see how this explanation can be correct.  The error handler only
sends a START_STOP command if sdev->allow_restart is one, which you have
to set in the slave_configure routines (which stex doesn't).  If you're
seeing a START_STOP in the eh path, there's something else wrong.
TEST_UNIT_READY, certainly ... it's part of a restart check.

James



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

* RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
@ 2007-04-04 17:31 Ed Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Ed Lin @ 2007-04-04 17:31 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, linux-kernel, jeff, Promise_Linux



> -----Original Message-----
> From: Ed Lin 
> Sent: Monday, April 02, 2007 4:02 PM
> To: James Bottomley
> Cc: linux-scsi; linux-kernel; jeff; Promise_Linux
> Subject: RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for 
> console device
> 
> 
> 
> 
> > -----Original Message-----
> > From: James Bottomley [mailto:James.Bottomley@SteelEye.com] 
> > Sent: Monday, April 02, 2007 11:28 AM
> > To: Ed Lin
> > Cc: linux-scsi; linux-kernel; jeff; Promise_Linux
> > Subject: RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for 
> > console device
> > 
> > 
> > On Mon, 2007-04-02 at 11:14 -0700, Ed Lin wrote:
> > > I just saw the routine name scsi_eh_try_stu, and didn't notice the
> > > allow_restart (partly because I thought it was not harmful...).
> > > But the TEST_UNIT_READY must stay.
> > 
> > Sure ... I was just checking since your change log implied 
> you'd seen
> > the problem from the error handler ... however, we can add it ...
> > there's a possibility of getting spin up on init from sd anyway.
> > 
> 
> You make the decision. But after reconsideration, I think it's better
> to remove unused code. It also needs change since the patch about
> id mapping is modified in another mail.
> 
> How about the attachment here?
>

Sorry. I think the mail server has problem with attachment. The patch
is here in plain text. Sorry for the inconvenience. I have problem with
linux-scsi mail list, if you have comment please cc me. Thanks.
--Ed Lin




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 <ed.lin@promise.com>
---
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; 

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

* RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
@ 2007-04-02 23:01 Ed Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Ed Lin @ 2007-04-02 23:01 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, linux-kernel, jeff, Promise_Linux

[-- Attachment #1: Type: text/plain, Size: 962 bytes --]



> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com] 
> Sent: Monday, April 02, 2007 11:28 AM
> To: Ed Lin
> Cc: linux-scsi; linux-kernel; jeff; Promise_Linux
> Subject: RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for 
> console device
> 
> 
> On Mon, 2007-04-02 at 11:14 -0700, Ed Lin wrote:
> > I just saw the routine name scsi_eh_try_stu, and didn't notice the
> > allow_restart (partly because I thought it was not harmful...).
> > But the TEST_UNIT_READY must stay.
> 
> Sure ... I was just checking since your change log implied you'd seen
> the problem from the error handler ... however, we can add it ...
> there's a possibility of getting spin up on init from sd anyway.
> 

You make the decision. But after reconsideration, I think it's better
to remove unused code. It also needs change since the patch about
id mapping is modified in another mail.

How about the attachment here?

[-- Attachment #2: s3 --]
[-- Type: application/octet-stream, Size: 893 bytes --]

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 <ed.lin@promise.com>
---
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;

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

* RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
  2007-04-02 18:14 Ed Lin
@ 2007-04-02 18:27 ` James Bottomley
  0 siblings, 0 replies; 6+ messages in thread
From: James Bottomley @ 2007-04-02 18:27 UTC (permalink / raw)
  To: Ed Lin; +Cc: linux-scsi, linux-kernel, jeff, Promise_Linux

On Mon, 2007-04-02 at 11:14 -0700, Ed Lin wrote:
> I just saw the routine name scsi_eh_try_stu, and didn't notice the
> allow_restart (partly because I thought it was not harmful...).
> But the TEST_UNIT_READY must stay.

Sure ... I was just checking since your change log implied you'd seen
the problem from the error handler ... however, we can add it ...
there's a possibility of getting spin up on init from sd anyway.

James



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

* RE: [PATCH 3/4] [SCSI]stex: fix reset recovery for console device
@ 2007-04-02 18:14 Ed Lin
  2007-04-02 18:27 ` James Bottomley
  0 siblings, 1 reply; 6+ messages in thread
From: Ed Lin @ 2007-04-02 18:14 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, linux-kernel, jeff, Promise_Linux



> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com] 
> Sent: Saturday, March 31, 2007 11:46 AM
> To: Ed Lin
> Cc: linux-scsi; linux-kernel; jeff; Promise_Linux
> Subject: Re: [PATCH 3/4] [SCSI]stex: fix reset recovery for 
> console device
> 
> 
> On Fri, 2007-03-30 at 15:21 -0700, Ed Lin wrote:
> > After reset completed, the scsi error handler sends out START_STOP
> > and TEST_UNIT_READY to the device. For 'normal' devices these
> > commands will be handled by firmware. However, because the RAID
> > console only interfaces to scsi mid layer, the firmware 
> will not process
> > these commands for it. This will make the console to be 
> offlined right
> > after reset. Add the handling in driver to fix this problem.
> 
> I don't see how this explanation can be correct.  The error 
> handler only
> sends a START_STOP command if sdev->allow_restart is one, 
> which you have
> to set in the slave_configure routines (which stex doesn't).  
> If you're
> seeing a START_STOP in the eh path, there's something else wrong.
> TEST_UNIT_READY, certainly ... it's part of a restart check.
> 

I just saw the routine name scsi_eh_try_stu, and didn't notice the
allow_restart (partly because I thought it was not harmful...).
But the TEST_UNIT_READY must stay.

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

end of thread, other threads:[~2007-04-04 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-30 22:21 [PATCH 3/4] [SCSI]stex: fix reset recovery for console device Ed Lin
2007-03-31 18:46 ` James Bottomley
2007-04-02 18:14 Ed Lin
2007-04-02 18:27 ` James Bottomley
2007-04-02 23:01 Ed Lin
2007-04-04 17:31 Ed Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).