On Sat, Jun 21, 2003 at 11:49:47AM -0700, Linus Torvalds wrote: > On Sat, 21 Jun 2003, Matthew Dharm wrote: > > > > However, my top suspect is the call to scsi_device_register() in > > scsi_add_lun(), which takes place _well_ before the sdev is properly > > configured. At first, I thought that just creates some devfs entries, but > > if that is what triggers the probing to sd.c, then that would explain all > > of this behavior. > > Registering the device is indeed very much what causes all probing to > happen.
Ah, and much becomes clear now. I really should sit down and study all
this new code, as I have not done so before.
> In short, if the code registers something before it is actually ready to
> accept commands, then yes, it's _seriously_ buggy. It had better be ready
> to accept commands by the time it is registered.
Well, even if this doesn't fix the problem, then at least we've uncovered a
bug that is easy to fix.
>
> > So, if my theory sounds correct to you, can you try moving the call to
> > scsi_device_register() to the end of scsi_add_lun()?
>
> Yes.
Let me know how this goes. Urgent house-maintance tasks have called me
away from this for the day.
> I also have this strong urge make the default "use_10_for_ms" value be 1,
> since making the default value 0 doesn't make much sense (we have code to
> automatically downgrade, but for that code to trigger, it must have been
> upgraded first).
I happen to agree with you, but many people object on the basis that it
changes existing behavior for devices where the current behavior is known
to work.
> Clearly MS uses the 10-byte versions, since a lot of flash readers don't
> even appear to support the 6-byte version. So it's arguably a lot safer to
> always start out with the 10-byte version, and this shouldn't be a USB
> storage special case.
All the other 'popular' OSes (as I refer to them), use READ_10 and
WRITE_10. MODE_SENSE is less clear.
Actully, I can state with (almost) certaintly that MS doesn't use either --
it determines write-protectedness by attempting to write to the disk and
being denied by the device. Nobody has ever seen a Windows host issue any
sort of MODE_SENSE command.
I have some rumors that suggest that Mac uses MODE_SENSE_10 to determine
write-protect status, but that is just a rumor.
However, as to your argument as to which is 'safer', I agree completely.
Again, the primary opposition comes from the "change is bad" group.
Matt
--
Matthew Dharm Home: [EMAIL PROTECTED]
Maintainer, Linux USB Mass Storage Driver
Now payink attention, please. This is mouse. Click-click. Easy to
use, da? Now you try...
-- Pitr to Miranda
User Friendly, 10/11/1998
pgp00000.pgp
Description: PGP signature
