This is a 2.4 question with a patch. I am having a deja-vu about it.
Please look at this and let me know if it prompts any associations:

--- linux-2.4.21-37.EL/drivers/usb/storage/usb.c        2005-10-03 
16:13:09.000000000 -0700
+++ linux-2.4.21-37.EL-x/drivers/usb/storage/usb.c      2006-02-22 
16:12:07.000000000 -0800
@@ -718,10 +718,13 @@ static void * storage_probe(struct usb_d
         * Now check if we have seen this GUID before
         * We're looking for a device with a matching GUID that isn't
         * already on the system
+        * Since GUID will be the same for all interfaces of a multi-
+        * interface storage device, check interface description text
+        * and try to match previous ifnum.
         */
        ss = us_list;
        while ((ss != NULL) && 
-              ((ss->pusb_dev) || !GUID_EQUAL(guid, ss->guid)))
+           (ss->pusb_dev || !GUID_EQUAL(guid, ss->guid) || ifnum != ss->ifnum))
                ss = ss->next;
 
        if (ss != NULL) {

In 2.6, if a device is disconnected, its SCSI block device is removed.
But in 2.4, it's kept and then the driver attempts to match it to
a USB device. In reality, we attach to interfaces, not devices.
And our lists are structured so that scsi devices get reattached
to wrong interfaces. For example, Dell DRAC5 has floppy, CD, and
a flash media. So, sda will be floppy initially, then it becomes
CD after replug, etc. This confuses applications.

The patch seems too simple. Why did we not have it in 2.4?

I thought about it, and it seems obvious, necessary, and safe,
even considering the mess with interface numbers, interface indexes,
and altsettings.

It feels vaguely as if we discussed this, but I cannot find anything.

Thanks,
-- Pete


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to