public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Lord <lkml@rtr.ca>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: usb device problem
Date: Tue, 06 Jun 2006 14:13:44 -0400	[thread overview]
Message-ID: <4485C5D8.5070907@rtr.ca> (raw)
In-Reply-To: <4485C446.2040203@rtr.ca>

Mark Lord wrote:
> Jiri Slaby wrote:
>> Mark Lord napsal(a):
>>> Jiri Slaby wrote:
..
>>>> ---
>>>> sd 10:0:0:0: SCSI error: return code = 0x10070000
>>>> end_request: I/O error, dev sdb, sector 1575
..
> The 0x1007000 is broken down as:
> 
> 07 == "host byte"   = DID_ERROR = "internal error"
> 10 == "driver byte" = SUGGEST_RETRY
..
>>> I have a patch to fix this behaviour (in sd.c), but it has not yet
>>> been decided whether to go upstream with it or not.
>>
>> Could you post me a copy, please?
> 
> Probably tomorrow.  I haven't ported it forward yet (from a much older 
> kernel).
> But I don't think it will help here now, as these errors
> don't really look like bad media -- gotta look inside the usb-storage 

Mmm.. okay, a quick glance at the USB storage code revealed one instance:

        /* Did we transfer less than the minimum amount required? */
        if (srb->result == SAM_STAT_GOOD &&
                        srb->request_bufflen - srb->resid < srb->underflow)
                srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24);

        return;

So I suppose this *could* be the driver thinking it had a bad sector,
but it really looks like it's guessing.  The code also appears to be
instrumented for some kind of USB tracing.. If you can figure out how
to turn that on, then the trace will probably tell us what is really
going on there. 

Look for a file called "usbmon.txt" in the Documentation/usb/ subdir
of your kernel source tree.  It describes how to do the tracing.

I'll also CC: you when I send out the SCSI error-recovery draft patch.

Cheers

  reply	other threads:[~2006-06-06 18:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06 15:09 usb device problem Jiri Slaby
2006-06-06 15:43 ` Mark Lord
2006-06-06 16:08   ` Jiri Slaby
2006-06-06 18:07     ` Mark Lord
2006-06-06 18:13       ` Mark Lord [this message]
2006-06-06 21:37         ` Jiri Slaby
2006-06-06 22:46           ` Jiri Slaby
2006-06-07 13:14             ` Mark Lord

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=4485C5D8.5070907@rtr.ca \
    --to=lkml@rtr.ca \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    /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