linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb hotplug problems with 2.6.10
@ 2005-02-03 15:03 Jack Howarth
  2005-02-03 17:45 ` Greg KH
  2005-02-03 18:39 ` Jason L Tibbitts III
  0 siblings, 2 replies; 3+ messages in thread
From: Jack Howarth @ 2005-02-03 15:03 UTC (permalink / raw)
  To: alan, linux-kernel

Alan,
   I had mentioned a couple weeks back that with kernel 2.6.10, 
the ability to hotplug usb keys in Fedora Core 2 and 3 has been broken.
There is actually a bugzilla report on this with some useful information
on manifestation of the problem....

https://bugzilla.redhat.com/beta/show_bug.cgi?id=119140

The problem can be hacked around for the moment in hotplug by
repeatedly calling updfstab until the device appears in both
/proc/scsi/scsi and /sys/bus/usb/drivers/usb-storage but it 
would be nice is this could be fixed in the kernel. Hasn't any
distributions other than Fedora run into this yet?
                     Jack
The hack recommended by Jason Tibbitts that works around this problem
is...

--- /root/hotplug.functions.sav 2005-02-03 09:17:28.433643468 -0500
+++ hotplug.functions   2005-02-03 09:21:32.336895753 -0500
@@ -146,6 +146,7 @@
                # parameters ... handle per-device parameters in apps
                # (ioctls etc) not in setup scripts or modules.conf
                LOADED=true
+               JUST_LOADED=true
            fi
        else
            # This module is already loaded
@@ -167,7 +168,18 @@
            mesg "missing kernel or user mode driver $MODULE "
        fi
        if echo "$MODULE" | grep -q "usb-storage" > /dev/null 2>&1 ; then
-           [ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab
+               if [ -x /usr/sbin/updfstab ]; then
+                       INITIAL_SCSI=$(cat /proc/scsi/scsi | wc -l)
+                       COUNT=10   # (big) upper bound of the loop
+                       while [ $COUNT -gt 0 ]; do
+                               sleep 1
+                               [ "$(cat /proc/scsi/scsi | wc -l)" -gt
+                               "$INITIAL_SCSI" ] && break
+                               COUNT=$(($COUNT - 1))
+                       done
+               fi
+               /usr/sbin/updfstab
+#          [ -x /usr/sbin/updfstab ] &&  /usr/sbin/updfstab
        fi
     done
 }

...its ugly of course but at least hotplugging usb keys work again
under 2.6.10.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: usb hotplug problems with 2.6.10
  2005-02-03 15:03 usb hotplug problems with 2.6.10 Jack Howarth
@ 2005-02-03 17:45 ` Greg KH
  2005-02-03 18:39 ` Jason L Tibbitts III
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2005-02-03 17:45 UTC (permalink / raw)
  To: Jack Howarth; +Cc: alan, linux-kernel

On Thu, Feb 03, 2005 at 10:03:10AM -0500, Jack Howarth wrote:
> Alan,
>    I had mentioned a couple weeks back that with kernel 2.6.10, 
> the ability to hotplug usb keys in Fedora Core 2 and 3 has been broken.
> There is actually a bugzilla report on this with some useful information
> on manifestation of the problem....
> 
> https://bugzilla.redhat.com/beta/show_bug.cgi?id=119140
> 
> The problem can be hacked around for the moment in hotplug by
> repeatedly calling updfstab until the device appears in both
> /proc/scsi/scsi and /sys/bus/usb/drivers/usb-storage but it 
> would be nice is this could be fixed in the kernel.

How do you propose "fixing" this in the kernel?  Userspace needs to be
changed to go off of the /dev node showing up, not the usb hotplug event
(which can happen much sooner, as you have found out.)

I would recommend bringing this up with the Fedora developers.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: usb hotplug problems with 2.6.10
  2005-02-03 15:03 usb hotplug problems with 2.6.10 Jack Howarth
  2005-02-03 17:45 ` Greg KH
@ 2005-02-03 18:39 ` Jason L Tibbitts III
  1 sibling, 0 replies; 3+ messages in thread
From: Jason L Tibbitts III @ 2005-02-03 18:39 UTC (permalink / raw)
  To: Jack Howarth; +Cc: alan, linux-kernel

>>>>> "JH" == Jack Howarth <howarth@bromo.msbb.uc.edu> writes:

JH> Alan, I had mentioned a couple weeks back that with kernel 2.6.10,
JH> the ability to hotplug usb keys in Fedora Core 2 and 3 has been
JH> broken.

The true issue is a little more complicated than that.  The kernel
issue here is that under 2.6.9 (or Red Hat's versions thereof)
usb-storage devices would be picked up by the SCSI layer immediately
after the usb-storage module became aware of them.  Under Red Hat's
2.6.10 (which currently includes -ac11) there is a delay of
five or ten seconds between the device appearing in
/sys/bus/usb/drivers/usb-storage and it showing up as a SCSI device.

This delay has broken some stuff.  Yes, Red Hat's userland hotplugging
bits made incorrect assumptions and should be fixed.  The question is
whether this kernel delay is intended and, if not, how to fix it.
Even after I've hacked around the userland problems I still have
people asking why it takes so long for their USB keys to show up.

 - J<

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-03 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-03 15:03 usb hotplug problems with 2.6.10 Jack Howarth
2005-02-03 17:45 ` Greg KH
2005-02-03 18:39 ` Jason L Tibbitts III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).