Re: 2.5.26 hotplug failure

From: Duncan Sands (duncan.sands@wanadoo.fr)
Date: Sun Sep 15 2002 - 16:53:41 EST


On Thursday 18 July 2002 20:36, Greg KH wrote:
> On Thu, Jul 18, 2002 at 09:50:42AM +0200, Duncan Sands wrote:
> > I just gave 2.5.26 a whirl. The first thing I noticed was
> > that the hotplug system didn't run the script for my usb
> > modem...
> >
> > kernel: usb.c: USB disconnect on device 2
> > kernel: hub.c: new USB device 00:0b.0-2, assigned address 4
> > kernel: usb.c: USB device 4 (vend/prod 0x6b9/0x4061) is not claimed by
> > any active driver. /etc/hotplug/usb.agent: ... no modules for USB product
> > 6b9/4061/0
> >
> > however this works just fine with 2.4.19-rc1 and 2.5.24 (i.e. only
> > difference is the change in kernel)...
>
> But that message is from the hotplug agent, right?
>
> What kind of script used to get run, and how was it run (i.e. on network
> interface registration, etc.)
>
> thanks,
>
> greg k-h

OK, I've worked out what was wrong (patch below): /proc/bus/usb was
being unmounted by the hotplug/usb.rc script. After loading a HCD, usb.rc
executes the following lines:

    if [ -d /proc/bus/usb ]; then
        # If we see there are no busses, we "failed" and
        # can report so even if we're partially nonmodular.
        COUNT=`ls /proc/bus/usb | wc -l`
        if [ $COUNT -le 2 ]; then
            umount /proc/bus/usb
            rmmod usbcore >/dev/null 2>&1
            return 1
        fi

In the 2.4 kernels, /proc/bus/usb contains at least

001 devices drivers

i.e. at least three entries. However sometime during
the 2.5 kernel series the drivers file went away. So
now there are only two entries and usb.rc unmounts
/proc/bus/usb.

A simple fix is to change the test to [ $COUNT -lt 2 ];

Duncan.

--- hotplug/usb.rc.orig 2002-09-15 23:29:14.000000000 +0200
+++ hotplug/usb.rc 2002-09-15 23:29:39.000000000 +0200
@@ -149,7 +149,7 @@
         # If we see there are no busses, we "failed" and
         # can report so even if we're partially nonmodular.
         COUNT=`ls /proc/bus/usb | wc -l`
- if [ $COUNT -le 2 ]; then
+ if [ $COUNT -lt 2 ]; then
             umount /proc/bus/usb
             rmmod usbcore >/dev/null 2>&1
             return 1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:38 EST