* How to make sd retry a command?
@ 2006-09-22 21:19 Alan Stern
2006-09-22 21:34 ` Brian King
0 siblings, 1 reply; 2+ messages in thread
From: Alan Stern @ 2006-09-22 21:19 UTC (permalink / raw)
To: SCSI development list
I've seen a few examples of USB storage devices that return clearly bogus
error information on occasion. For instance, the device might return
CHECK CONDITION status with SK=5 (Illegal request) and ASC=20 (Invalid
command) for a WRITE_10, even though it has accepted many other READ_10
and WRITE_10 commands previously. I don't know why the device does this.
When this happens, rather than failing the transfer entirely it makes
sense to retry it. Right now sd will switch over from WRITE_10 to
WRITE_6, which is definitely the wrong thing to do. I can prevent that
easily enough. The question is how to force a retry.
What information should sd_rw_intr() pass to scsi_io_completion() to
request a retry? Or is there some other way of doing it?
And how can the number of retries be limited, say to 3?
Alan Stern
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to make sd retry a command?
2006-09-22 21:19 How to make sd retry a command? Alan Stern
@ 2006-09-22 21:34 ` Brian King
0 siblings, 0 replies; 2+ messages in thread
From: Brian King @ 2006-09-22 21:34 UTC (permalink / raw)
To: Alan Stern; +Cc: SCSI development list
Alan Stern wrote:
> I've seen a few examples of USB storage devices that return clearly bogus
> error information on occasion. For instance, the device might return
> CHECK CONDITION status with SK=5 (Illegal request) and ASC=20 (Invalid
> command) for a WRITE_10, even though it has accepted many other READ_10
> and WRITE_10 commands previously. I don't know why the device does this.
>
> When this happens, rather than failing the transfer entirely it makes
> sense to retry it. Right now sd will switch over from WRITE_10 to
> WRITE_6, which is definitely the wrong thing to do. I can prevent that
> easily enough. The question is how to force a retry.
>
> What information should sd_rw_intr() pass to scsi_io_completion() to
> request a retry? Or is there some other way of doing it?
>
> And how can the number of retries be limited, say to 3?
scsi_decide_disposition in scsi_error.c is what controls whether or not
a failed command gets retried. If you know that you might want a failed
command retried, you can set DID_ERROR, which may force a retry,
depending on if the retry counter has been exceeded yet or not.
Brian
--
Brian King
eServer Storage I/O
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-22 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-22 21:19 How to make sd retry a command? Alan Stern
2006-09-22 21:34 ` Brian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox