From: Brian King <brking@us.ibm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: How to make sd retry a command?
Date: Fri, 22 Sep 2006 16:34:48 -0500 [thread overview]
Message-ID: <451456F8.2000800@us.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0609221711240.8511-100000@iolanthe.rowland.org>
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
prev parent reply other threads:[~2006-09-22 21:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-22 21:19 How to make sd retry a command? Alan Stern
2006-09-22 21:34 ` Brian King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=451456F8.2000800@us.ibm.com \
--to=brking@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox