Re: [linux-usb-devel] Re: [PATCH] USB changes for 2.5.58

Matthew Dharm
2003-01-16T22:51:07Z

[-- Attachment #1: Type: text/plain, Size: 2676 bytes --]

On Thu, Jan 16, 2003 at 08:10:18PM +0000, Linus Torvalds wrote:
> In article <20030116195306.GA32697@kroah.com>, Greg KH <greg@kroah.com> wrote:
> >On Thu, Jan 16, 2003 at 11:43:23AM -0800, Matthew Dharm wrote:
> >> Well, we only create the host when the device is first attached. After
> >> that, if it goes away and comes back, we re-connect it to the old SCSI
> >> host.
> >
> >Ick, so when the device is gone, where does the SCSI host go? Is it
> >still represented in sysfs and in the SCSI core properly?
>
> This is pure and utter USB storage stupidity, and nothing else.

Well, I happen to agree. But it was a necessary evil.

Up until recently, an attempt to hot-unplug a SCSI host would result is
gross system instability.

Also, up until recently, the debounce on USB ports means that a usb-storage
device could get disconnected and reconnected when a completely unrelated
device was attached to a hub. Newer hubs fixed this.

Also, the _vast_ majority of devices keep sane serial numbers. You happen
to have one of the broken ones, which tends to skew your perception. But
of the two dozen or so storage devices I have, only one exhibits that
problem (and only with the old firmware loaded).

I'd like to fix this. I've been wanting to fix this for a while. I want
SCSI hot-unplug to work well enough to rely on it. I want to be able to
take a USB disk, unplug it while writing to it, plug in a new USB disk, and
have a guarantee that the SCSI layer won't get confused and try to write
the data for the old disk to the new one (think scsi0 goes away, to be
replaced by a new scsi0, without properly stopping command initiators).

Heck, it was only in early 2.4.x that the SCSI mid-layer fixed an
off-by-one error that made it queue one-too-many commands to a HBA.

So, here's how it is: We all want it fixed. Linus, if you're willing to
deal with a major change for this at this late-date in the 2.5.x lifecycle,
then we'll do it. Simple as that. That's pretty much the only reason I
haven't started already -- the SCSI add-ons that support the hot-unplug
were too new and too late for me to be comfortable making a major change
like this.

Matt

P.S. BTW, this is also the original behavior of usb-storage, all the way
back to before I was working on it (and before it was called usb-storage).
I've never liked it this way...

--
Matthew Dharm Home: mdharm-usb@one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver

Hey Chief. We've figured out how to save the technical department. We
need to be committed.
-- The Techs
User Friendly, 1/22/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]