All of lore.kernel.org
 help / color / mirror / Atom feed
* 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; 50+ 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] 50+ messages in thread

end of thread, other threads:[~2003-10-24 14:41 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-22 22:55 [linux-usb-devel] Re: USB storage problems on OHCI Pat LaVarre
2003-09-29 14:54 ` Pat LaVarre
2003-09-29 15:50   ` 2 KiB/block loopback found where Pat LaVarre
2003-09-29 16:46     ` Jens Axboe
2003-09-29 17:12       ` Pat LaVarre
2003-09-29 20:02         ` Pat LaVarre
2003-10-06 17:12           ` max GiB written per boot Pat LaVarre
2003-10-06 18:12             ` writable mmc profiles actually are writable Pat LaVarre
2003-10-06 18:22               ` Jens Axboe
2003-10-06 18:25                 ` Jens Axboe
2003-10-06 19:50                   ` Pat LaVarre
2003-10-06 20:38                     ` Jens Axboe
2003-10-06 20:58                       ` Pat LaVarre
2003-10-06 22:14                         ` Pat LaVarre
2003-10-06 23:56                           ` Pat LaVarre
2003-10-07  5:38                             ` Jens Axboe
2003-10-07  6:45                               ` Matthew Dharm
2003-10-07  6:48                                 ` Jens Axboe
2003-10-07  7:00                                   ` Matthew Dharm
2003-10-07  7:04                                     ` Jens Axboe
2003-10-10 20:36                                       ` Pat LaVarre
2003-10-10 21:04                                         ` Pat LaVarre
2003-10-10 21:25                                           ` Pat LaVarre
2003-10-10 22:43                                             ` Pat LaVarre
2003-10-10 23:16                                               ` Pat LaVarre
2003-10-11  0:43                                                 ` Pat LaVarre
2003-10-07 20:46                               ` Pat LaVarre
2003-10-07 21:00                                 ` Jens Axboe
2003-10-09 23:01                                   ` Pat LaVarre
2003-10-07  7:00                         ` Jens Axboe
2003-10-06 20:10                 ` Pat LaVarre
2003-10-06 20:28                   ` Jens Axboe
2003-10-06 20:21                 ` Pat LaVarre
2003-10-06 20:33                   ` Jens Axboe
2003-10-06 21:00             ` max GiB written per boot Pat LaVarre
2003-10-06 23:47               ` Pat LaVarre
2003-10-07  5:57                 ` Jens Axboe
2003-10-07 22:12                   ` Randy.Dunlap
2003-10-07 22:57                     ` Willem Riede
2003-10-08  1:27                       ` Randy.Dunlap
2003-10-08  4:34                         ` Randy.Dunlap
2003-10-08  6:44                           ` Jens Axboe
2003-10-09 21:59                     ` Pat LaVarre
2003-10-10 20:54                       ` Pat LaVarre
2003-10-07  0:51         ` 2 KiB/block loopback found where Pat LaVarre
2003-09-29 17:55     ` aligned /dev/scd$n reads less rare how Pat LaVarre
2003-09-29 19:39       ` zip of GiB cross-platform Pat LaVarre
2003-09-29 19:50         ` Matthew Wilcox
2003-09-29 19:56           ` Pat LaVarre
2003-10-24 14:41       ` aligned /dev/scd$n reads less rare how Pat LaVarre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.