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 - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html