public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [linux-usb-devel] Re: USB storage problems on OHCI..
@ 2003-09-23 14:37 Andries.Brouwer
  2003-09-23 14:51 ` James Bottomley
  2003-09-23 15:46 ` Linus Torvalds
  0 siblings, 2 replies; 38+ messages in thread
From: Andries.Brouwer @ 2003-09-23 14:37 UTC (permalink / raw)
  To: Andries.Brouwer, James.Bottomley
  Cc: david-b, greg, hch, linux-scsi, linux-usb-devel, mdharm-usb,
	patmans, stern, torvalds

    From James.Bottomley@SteelEye.com  Tue Sep 23 16:05:21 2003

    > Also "conservative mode" sounds like a flag that describes some
    > way of being broken.
    > 
    > On the other hand "hot-pluggable" describes a positive asset,
    > and if we can conclude from that that it is unnecessary to ask
    > for mode page 8 then we achieve the same effect in a positive way.

    I disagree on this one.  hot-pluggable sounds like it should be set for
    ever hotplug device (currently that would include firewire, which may be
    iffy, and Fibre Channel, which has our highest level of SCSI compliance
    and would definitely be wrong).

Why would it be wrong?

    The design goal is that this flag makes sd assume as little SCSI
    standards compliance as it can get away with while still operating the
    device.

No, the design goal of "hot-pluggable" is that it indicates that
the device can disappear any moment. Nothing at all about SCSI
compliance.

Pulling out a device while it is actively reading or writing
will probably break something. But if a device is hot-pluggable
it should be OK to pull it out when it has been inactive for
a second or so.

But if that is really true, then it should not be necessary
to send the device any "synchronise cache" commands when we
shut down.

And if no such commands will be sent anyway, then we need not ask
the device about its type of cache.

And if we do not ask, then we need not worry whether the device
is sufficiently compliant to answer such a question.

Andries

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [linux-usb-devel] Re: USB storage problems on OHCI..
@ 2003-09-22 23:07 Andries.Brouwer
  0 siblings, 0 replies; 38+ messages in thread
From: Andries.Brouwer @ 2003-09-22 23:07 UTC (permalink / raw)
  To: linux-scsi, linux-usb-devel, p.lavarre
  Cc: andries.brouwer, hch, james.bottomley, mdharm-scsi, stern,
	torvalds

> Tell me we care to hear specifically what some win sends to some of my
> usb hdd/rmb, and I'll go collect a few sample usb bus traces.

I'll collect and publish.
(Change the subject line to "USB storage traces" or so.)
Must have some old traces somewhere myself too.

Andries

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [linux-usb-devel] Re: USB storage problems on OHCI..
@ 2003-09-22 22:55 Pat LaVarre
  2003-09-29 14:54 ` Pat LaVarre
  0 siblings, 1 reply; 38+ messages in thread
From: Pat LaVarre @ 2003-09-22 22:55 UTC (permalink / raw)
  To: linux-scsi, linux-usb-devel
  Cc: torvalds, mdharm-scsi, stern, hch, james.bottomley,
	andries.brouwer


> From: Linus Torvalds <torvalds () osdl ! org>
> Date: 2003-09-22 19:55:30
> ...
> How about just trusting the size ...
> and capping it at 20?

Besides dramatic overestimates of mode sense additional length, I've
also seen the off-by-one slight overestimate and the high-byte-zeroed
dramatic underestimate.

> General MODE SENSE stuff is in:
> http://www.t10.org/ftp/t10/drafts/spc3/spc3r15.pdf

Yes, but t10 mmc often quietly contradicts & overrides t10 spc for pdt
x05 dvd/cd and for atapi pdt x00 hdd/rmb.  For t10 newbies wanting to
fetch the bleeding edge, latest final draft, oldest still available,
etc. I sometimes recommend the index:

http://www.t10.org/scsi-3.htm

> > A scsi device declares its level of scsi compliance.
> ...
> From: Matthew Dharm <mdharm-scsi () one-eyed-alien ! net>
> Date: 2003-09-22 20:51:59
> ...
> reporting of 0, 1, 2, or something random ...
> appears ... unrelated to the capabilities of the device ...

The pernicious idea of zeroing the scsi revision in byte 2 of op x12
inquiry forms part of how mmc quietly redefines spc.  Misapplying the
sff precursor of the pdt x05 mmc spec to pdt x00 devices is part of how
msft whql qualified atapi pdt x00 devices for sale thru oem's in the
late 1990's.

> > > > From: Alan Stern <stern () rowland ! harvard ! edu>
> > > > Date: 2003-09-22 14:25:28
> > > > ...
> > > > many, many USB storage devices.  
> > > > They just don't handle MODE-SENSE page 8 correctly.
> > >
> > > From: Linus Torvalds <torvalds () osdl ! org>
> > > Date: 2003-09-22 16:09:47
> > > ...
> > > How about just making the sd.c layer more robust? 
> >
> > From: Alan Stern <stern () rowland ! harvard ! edu>
> > Date: 2003-09-22 16:42:52
> > ...
> > variety of ways ... fail ... truly amazing.
>
> From:  Christoph Hellwig <hch () infradead ! org>
> Date: 2003-09-22 17:21:42
> ...
> for those usb-storage devices where ...
> nothing that isn't excercised by the windows drivers
> has the slightest chance of working..

In the sd world, usb hdd/rmb (pdt x00) may handle specifically the mode
sense of page 8 that win sends.

For usb bInterfaceSubClass = x06 TransparentScsi that cdb might be:
x 1A 00:08:00 18 00

For usb bInterfaceSubClass != x06 TransparentScsi that cdb might be:
x 5A 00 08:00:00:00 00 00:1C 00

usb dvd/cd (pdt x05) sell into the sr/ide-cd world instead, of course.

Tell me we care to hear specifically what some win sends to some of my
usb hdd/rmb, and I'll go collect a few sample usb bus traces.  I do NOT
know that the above cdb's are correct.  Those are just my guesses,
summing up little clues from years of messing around near here.  I hear
in particular that win 9x/me differs from win 2k/xp near hear.

> Subject:  Re: [linux-usb-devel] Re: USB storage problems on OHCI..
> From: Linus Torvalds <torvalds () osdl ! org>
> Date: 2003-09-22 17:41:47
> ...
> is it saner to try to read just the bytes we need
> (3 bytes: page code, page size and the cache bits),
> or the full 20 bytes?

I thought "everyone knew" sanest was to always fetch header + block
descriptors + whole pages?

Trouble is, that's a circular definition in that the host can't know
whether the device will volunteer an optional block descriptor or not. 
mmc says shall not, spc says maybe not but should.

We only have to care if we have to know how many Data bytes to expect to
copy In.

> From: Andries.Brouwer () cwi ! nl
> Date: 2003-09-22 18:55:22
> ...
> Similarly, USB storage devices tend to ...
> only systematically work
> if one does precisely what Windows does.

Yes, what ain't tested don't work.

> USB is hot pluggable,
> so it should not be necessary
> to send a flush cache command at shutdown.

Who has tested this rule?  I know I've seen ata hdd lose data in
response to a pin 1 reset issued without op x35 sync cache.  I've heard
same of dvd.  And loss of bus power can kill any write cache in a drive,
of course.

> From: James Bottomley <James.Bottomley () steeleye ! com>
> Date: 2003-09-22 17:55:09 ...
> ...
> I think we could try 4 bytes

We know that isn't talk like windows.  msdn.microsoft.com tells us the
win 2k kernel crashes if a root-privileged app asks for just the 4 byte
header from devices for which Win translates to x5A MODE_SENSE_10 from
x1A MODE_SENSE  Because the win 2k kernel crashes so reliably, we can
confidently guess no working win 2k apps talk that way.

> From: James Bottomley <James.Bottomley () steeleye ! com>
> Date: 2003-09-22 19:28:56
> ...
> sd? ... the most conservative ..., we could probably
> dump spin up, read write protect, and read cache type ...

Aye, although in sr/ide-cd we have a default of not writable to overcome
somehow.

Pat LaVarre




^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: [linux-usb-devel] Re: USB storage problems on OHCI..
@ 2003-09-22 19:56 Andries.Brouwer
  2003-09-22 20:48 ` Alan Stern
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Andries.Brouwer @ 2003-09-22 19:56 UTC (permalink / raw)
  To: Andries.Brouwer, James.Bottomley
  Cc: david-b, greg, hch, linux-scsi, linux-usb-devel, mdharm-usb,
	patmans, stern, torvalds

    From James.Bottomley@SteelEye.com  Mon Sep 22 21:29:06 2003

    On Mon, 2003-09-22 at 13:55, Andries.Brouwer@cwi.nl wrote:
    >         if (sdkp->media_present) {
    >                 sd_read_capacity(sdkp, disk->disk_name, sreq, buffer);
    >                 if (sdp->removable)
    >                         sd_read_write_protect_flag(sdkp, disk->disk_name,
    >                                         sreq, buffer);
    >                 sd_read_cache_type(sdkp, disk->disk_name, sreq, buffer);
    >         }
    > 
    > and I suppose we could skip sd_read_cache_type() in the
    > hot-pluggable case - a flag that USB storage could set.

    what about just having a conservative mode for sd?  This could still
    internally be a set of flags, just one single way of clearing them all
    from slave configure.  For the most conservative setting, we could
    probably dump spin up, read write protect, and read cache type.

Maybe.

[By the way - reading Write Protect is meaningful and works,
for my Smart Media card readers.]

I have seen proposals around here for flags that are far too specific
(like "do not ask for mode page 8"). If we go to that level of detail
then we'll soon have fifty flags.
Black lists, and flags that describe various ways of being broken
are a bad idea in my opinion. I will not deny that they may be needed
in some cases, but they are never the preferred solution.

Also "conservative mode" sounds like a flag that describes some
way of being broken.

On the other hand "hot-pluggable" describes a positive asset,
and if we can conclude from that that it is unnecessary to ask
for mode page 8 then we achieve the same effect in a positive way.


There is another comment here.
A scsi device declares its level of scsi compliance.
Most USB storage devices are not very scsi compliant at all,
and report 0 there.
To everybody's surprise USB storage does

        US_DEBUGP("Fixing INQUIRY data to show SCSI rev 2 - was %d\n",
                  data_ptr[2] & 7);

        /* Change the SCSI revision number */
        data_ptr[2] = (data_ptr[2] & ~7) | 2;

It claims that the device is SCSI-2 compliant, even when the
device itself does not make that claim at all.


Suppose that we stop changing this compliance level.
Then getting SCSI-1 or no compliance level could be a
"conservative mode" flag.

[Of course this was done for a reason - USB storage was written
assuming the SCSI layer given. If we stop changing the SCSI level
that may require changes in the SCSI code. Probably Matt remembers
what the problems were.]

Andries

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
@ 2003-09-22 18:55 Andries.Brouwer
  2003-09-22 19:28 ` [linux-usb-devel] " James Bottomley
  0 siblings, 1 reply; 38+ messages in thread
From: Andries.Brouwer @ 2003-09-22 18:55 UTC (permalink / raw)
  To: patmans, torvalds
  Cc: Andries.Brouwer, david-b, greg, hch, linux-scsi, linux-usb-devel,
	mdharm-usb, stern

> Basically, Andries Brouwer's strategy of making sd.c more conservative has
> been a very successful one in the past. Why not continue on that?

% I would be interested in hearing what Andries has to say. ...
% The variety of ways in which these things fail is truly amazing.

Yes.

We have just seen this for keyboards: keypresses work, modifier key
releases work, and as soon as one assumes anything more there turn
out to be keyboards that fail.

Similarly, USB storage devices tend to fail whatever one tries,
and only systematically work if one does precisely what Windows
does. For SCSI disks things are not nearly as bad - there are
only a few manufacturers and they mostly produce quality stuff.

This means that carefully reading the SCSI standard is a useful
activity if one writes for SCSI disks. But for USB storage it
is more productive to trace the commands the various flavours
of Windows send.

(Yes, I am willing to collect whatever people send me, and put up
a web page describing the Windows way of addressing USB storage.)

So, I agree with Linus (and with myself :-)) - in the absence of
precise knowledge about the device and about its Windows drivers
all that is left is being as conservative as possible.
And I agree with Alan - even though being careful is a very good idea,
it does not help in all cases.

There are some general things we can do - for CF cards and the like
we probably do not want to read the cache type - USB is hot pluggable,
so it should not be necessary to send a flush cache command at shutdown.
Today I see

        if (sdkp->media_present) {
                sd_read_capacity(sdkp, disk->disk_name, sreq, buffer);
                if (sdp->removable)
                        sd_read_write_protect_flag(sdkp, disk->disk_name,
                                        sreq, buffer);
                sd_read_cache_type(sdkp, disk->disk_name, sreq, buffer);
        }

and I suppose we could skip sd_read_cache_type() in the
hot-pluggable case - a flag that USB storage could set.

Andries


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
  2003-09-22 17:41 ` [linux-usb-devel] " Linus Torvalds
@ 2003-09-22 17:55 James Bottomley
  2003-09-22 19:55 ` [linux-usb-devel] " Linus Torvalds
  -1 siblings, 1 reply; 38+ messages in thread
From: James Bottomley @ 2003-09-22 17:55 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Patrick Mansfield, Christoph Hellwig, Alan Stern, Matthew Dharm,
	David Brownell, Greg KH, USB development list,
	SCSI development list, Andries.Brouwer

On Mon, 2003-09-22 at 12:41, Linus Torvalds wrote:
> Ok, thanks. In particular, it seems to be pointless to read anything past 
> byte 20 - nothing past there is even defined.
> 
> What's the general sense of things - for a random SCSI device with bugs 
> (and they all have _some_ sort of bugs, let's not just rain on USB here), 
> is it saner to try to read just the bytes we need (3 bytes: page code, 
> page size and the cache bits), or the full 20 bytes?

Generally, we used to do that...we did run across devices (I won't say
which) which tried to send more...i.e. there was a minimum size they
wouldn't transfer below.  By and large, I think it was the headers of
translated commands, though, so as long as we ask for the header +
minimum we need, we should be safe.

I think we could try 4 bytes for this (even to avoid wide residue
problems) and see how it goes.

James




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
@ 2003-09-22 17:29 Linus Torvalds
  2003-09-22 17:49 ` [linux-usb-devel] " David Brownell
  0 siblings, 1 reply; 38+ messages in thread
From: Linus Torvalds @ 2003-09-22 17:29 UTC (permalink / raw)
  To: David Brownell
  Cc: Alan Stern, Matthew Dharm, Greg KH, USB development list,
	SCSI development list


On Mon, 22 Sep 2003, David Brownell wrote:
> 
> In this case, because it's not "EHCI + USB 2.0 hub", it's still using
> the OHCI companion controller.  So that wasn't a new case.

Ok. Here's the broken case with an added usb-2 hub in between. It is 
indeed a bit different.

Again, this case worked fine with the sd.c changes, so it does seem to be 
all related to "big" transfers out of the mode page.

		Linus

---
hub 1-4.1:0: new USB device on port 1, assigned address 4

usb-storage: USB Mass Storage device detected
usb-storage: act_altsetting is 0, id_index is 76
usb-storage: -- associate_dev
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: Endpoints: In: 0xe9d80140 Out: 0xe9d80154 Int: 0x00000000 (Period 0)
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
usb-storage: GetMaxLUN command result is -32, data is 0
usb-storage: *** thread sleeping.

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 36 bytes
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 25 00
usb-storage: Bulk Command S 0x43425355 T 0x2 L 37 F 128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 37 bytes
usb-storage: Status code 0; transferred 36/37
usb-storage: -- short transfer
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.

  Vendor: TOSHIBA   Model: THNCF1G02MA       Rev: 0811
  Type:   Direct-Access                      ANSI SCSI revision: 02

usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 0 F 0 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command READ_CAPACITY (10 bytes)
usb-storage:  25 00 00 00 00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0x4 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.

SCSI device sda: 2000880 512-byte hdwr sectors (1024 MB)

usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 3f 00 00 00 00 00 08 00
usb-storage: Bulk Command S 0x43425355 T 0x5 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.

sda: Write Protect is off
sda: Mode Sense: 06 00 00 00

usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 08 00 00 00 00 00 08 00
usb-storage: Bulk Command S 0x43425355 T 0x6 L 8 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 8 bytes
usb-storage: Status code 0; transferred 8/8
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 08 00 00 00 00 00 80 00
usb-storage: Bulk Command S 0x43425355 T 0x7 L 128 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 128 bytes
usb-storage: Status code -32; transferred 0/128
usb-storage: clearing endpoint halt for pipe 0xc0008480
usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: usb_stor_clear_halt: result = -104
usb-storage: Bulk data transfer result 0x4
usb-storage: -- transport indicates error, resetting
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 08 00 00 00 00 00 80 00
usb-storage: Bulk Command S 0x43425355 T 0x8 L 128 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 128 bytes
usb-storage: Status code -32; transferred 0/128
usb-storage: clearing endpoint halt for pipe 0xc0008480
usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: usb_stor_clear_halt: result = -104
usb-storage: Bulk data transfer result 0x4
usb-storage: -- transport indicates error, resetting
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 08 00 00 00 00 00 80 00
usb-storage: Bulk Command S 0x43425355 T 0x9 L 128 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 128 bytes
usb-storage: Status code -32; transferred 0/128
usb-storage: clearing endpoint halt for pipe 0xc0008480
usb-storage: usb_stor_control_msg: rq=01 rqtype=02 value=0000 index=81 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: usb_stor_clear_halt: result = -104
usb-storage: Bulk data transfer result 0x4
usb-storage: -- transport indicates error, resetting
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: scsi cmd done, result=0x70000
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command MODE_SENSE_10 (10 bytes)
usb-storage:  5a 00 08 00 00 00 00 00 80 00
usb-storage: Bulk Command S 0x43425355 T 0xa L 128 F 128 Trg 0 LUN 0 CL 10
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: command_abort called
usb-storage: usb_stor_stop_transport called
usb-storage: -- cancelling URB
usb-storage: Status code -104; transferred 0/31
usb-storage: -- transfer cancelled
usb-storage: Bulk command transfer result=4
usb-storage: -- command was aborted
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: scsi command aborted
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command TEST_UNIT_READY (6 bytes)
usb-storage:  00 00 00 00 00 00
usb-storage: Bulk Command S 0x43425355 T 0xa L 0 F 0 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: command_abort called
usb-storage: usb_stor_stop_transport called
usb-storage: -- cancelling URB
usb-storage: Status code -104; transferred 0/31
usb-storage: -- transfer cancelled
usb-storage: Bulk command transfer result=4
usb-storage: -- command was aborted
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: scsi command aborted
usb-storage: *** thread sleeping.
usb-storage: device_reset called
usb-storage: usb_stor_Bulk_reset called
usb-storage: usb_stor_control_msg: rq=ff rqtype=21 value=0000 index=00 len=0
usb-storage: Timeout -- cancelling URB
usb-storage: Soft reset failed: -104
usb-storage: bus_reset called



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
  2003-09-22 16:09         ` [linux-usb-devel] " Linus Torvalds
@ 2003-09-22 17:23 Patrick Mansfield
  2003-09-22 17:41 ` [linux-usb-devel] " Linus Torvalds
  -1 siblings, 1 reply; 38+ messages in thread
From: Patrick Mansfield @ 2003-09-22 17:23 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Christoph Hellwig, Alan Stern, Matthew Dharm, David Brownell,
	Greg KH, USB development list, SCSI development list,
	Andries.Brouwer

On Mon, Sep 22, 2003 at 09:09:47AM -0700, Linus Torvalds wrote:

> 
> (Btw, where are the different mode sense pages documented?)
> 

The latest SCSI 3 draft standards are online as follows, the SCSI 2 specs
are also online at www.t10.org (.ORG!).

For block (applies to some USB mass storage) specific pages:

http://www.t10.org/ftp/t10/drafts/sbc/sbc-r08c.pdf

See page 105 section 7.1.3 of the above (table 73 the "Mode page codes").

General MODE SENSE stuff is in:

http://www.t10.org/ftp/t10/drafts/spc3/spc3r15.pdf

See page 151 section 6.9.1 for MODE SENSE, page 261 section 7.4.5 or so
for page codes applying to all devices.

-- Patrick Mansfield


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
  2003-09-22 15:29   ` Linus Torvalds
@ 2003-09-22 16:22 David Brownell
  2003-09-22 16:31 ` [linux-usb-devel] " Linus Torvalds
  2003-09-22 16:58 ` Martin Diehl
  -1 siblings, 2 replies; 38+ messages in thread
From: David Brownell @ 2003-09-22 16:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alan Stern, Matthew Dharm, Greg KH, USB development list,
	SCSI development list

Linus Torvalds wrote:
> On Mon, 22 Sep 2003, Alan Stern wrote:
> 
>>This problem has been cropping up with many, many USB storage devices.  
> 
> 
> Interesting data-point: the device is a happy EHCI camper, and is totally 
> able to read codepage 8 on EHCI.
> 
> However, if I put it behind a USB-1 hub on the EHCI port, I see the same 
> problems I saw with OHCI.

Can you be more clear?  Is that

    (EHCI/OHCI) root port --> USB 2.0 hub --> USB 1.1 hub --> storage device

Or instead

    (EHCI/OHCI) root port --> USB 1.1 hub --> storage device

The former is certainly using EHCI, and the transaction translator in
that USB 2.0 hub ... but I'd expect it to give a different failure mode.
Maybe the same net result, but a different fault code (not -EOVERFLOW),
and likely different recovery procedure in usb-storage/scsi.

The latter is identical with the OHCI-only case, the only involvement
of EHCI being to hand that port over to the (OHCI) companion.


> So it is somehow related to USB-1 vs USB-2. I don't understand why the 
> device would make a difference for something like mode page 8, but it 
> looks like it transfers data fine for _small_ mode page requests under 
> USB-1, and under USB-2 it works even for big ones.

It could be some kind of logic in the device forgetting that to use
the right maxpacket setting in that specific case.

I'm a bit more used to seeing failures the other way around, where
the storage adapter doesn't quite respond correctly at high speed.

- Dave


> 
> 		Linus
> 
> 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: Re: USB storage problems on OHCI..
  2003-09-22 15:50       ` Alan Stern
@ 2003-09-22 15:58 Patrick Mansfield
  2003-09-22 16:36 ` [linux-usb-devel] " Alan Stern
  -1 siblings, 1 reply; 38+ messages in thread
From: Patrick Mansfield @ 2003-09-22 15:58 UTC (permalink / raw)
  To: Alan Stern
  Cc: Christoph Hellwig, Matthew Dharm, Linus Torvalds, David Brownell,
	Greg KH, USB development list, SCSI development list

On Mon, Sep 22, 2003 at 11:50:47AM -0400, Alan Stern wrote:

> Interestingly, my original patch was a lot like you describe.  It can be 
> found in
> 
> http://marc.theaimsgroup.com/?l=linux-scsi&m=106340167723122&w=2
> 
> Patrick Mansfield later beefed it up to the version you were looking at.
> 
> I don't care which version of the patch gets accepted, so long as
> _something_ is done.  Patrick, what do you think?

I would rather we can modify the flags for any broken device and override
a host's setting for known functioning devices. But let's get some patch
applied.

If there is a problem (per Linus' post) in the USB transport this isn't a
real fix.

-- Patrick Mansfield


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

^ permalink raw reply	[flat|nested] 38+ messages in thread
[parent not found: <20030922004943.E32009@one-eyed-alien.net>]

end of thread, other threads:[~2003-10-03 21:37 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-23 14:37 [linux-usb-devel] Re: USB storage problems on OHCI Andries.Brouwer
2003-09-23 14:51 ` James Bottomley
2003-09-23 15:23   ` Alan Stern
2003-09-24 14:10     ` [linux-usb-devel] " James Bottomley
2003-09-23 15:46 ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2003-09-22 23:07 Andries.Brouwer
2003-09-22 22:55 Pat LaVarre
2003-09-29 14:54 ` Pat LaVarre
2003-09-22 19:56 Andries.Brouwer
2003-09-22 20:48 ` Alan Stern
2003-09-22 20:51 ` Matthew Dharm
2003-09-23 14:04 ` James Bottomley
2003-09-22 18:55 Andries.Brouwer
2003-09-22 19:28 ` [linux-usb-devel] " James Bottomley
2003-09-22 17:55 James Bottomley
2003-09-22 19:55 ` [linux-usb-devel] " Linus Torvalds
2003-09-23 17:47   ` Ruud Linders
2003-09-23 18:16     ` Linus Torvalds
2003-09-24 16:40       ` Ruud Linders
2003-09-24 16:53         ` Linus Torvalds
2003-09-26 18:43           ` Alan Stern
2003-10-03 14:18             ` Alan Stern
2003-10-03 15:05               ` James Bottomley
2003-10-03 21:35                 ` Patrick Mansfield
2003-09-22 17:29 Linus Torvalds
2003-09-22 17:49 ` [linux-usb-devel] " David Brownell
2003-09-22 18:40   ` Linus Torvalds
2003-09-22 17:23 Patrick Mansfield
2003-09-22 17:41 ` [linux-usb-devel] " Linus Torvalds
2003-09-22 16:22 David Brownell
2003-09-22 16:31 ` [linux-usb-devel] " Linus Torvalds
2003-09-22 16:58 ` Martin Diehl
2003-09-22 17:19   ` David Brownell
2003-09-22 15:58 Patrick Mansfield
2003-09-22 16:36 ` [linux-usb-devel] " Alan Stern
     [not found] <20030922004943.E32009@one-eyed-alien.net>
2003-09-22 14:25 ` Alan Stern
2003-09-22 14:31   ` Christoph Hellwig
2003-09-22 15:11     ` Christoph Hellwig
2003-09-22 15:49       ` Patrick Mansfield
2003-09-22 16:09         ` [linux-usb-devel] " Linus Torvalds
2003-09-22 16:37         ` Christoph Hellwig
2003-09-22 16:44           ` Patrick Mansfield
2003-09-22 17:21             ` Christoph Hellwig
2003-09-22 19:01               ` Alan Stern
2003-09-22 15:50       ` Alan Stern
2003-09-22 15:29   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox