linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hotplug usb.rc changes
@ 2003-06-07 16:56 Olaf Hering
  2003-06-07 17:51 ` Olaf Hering
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Olaf Hering @ 2003-06-07 16:56 UTC (permalink / raw)
  To: linux-hotplug


A few updates for usb.rc:

- do not use /etc/sysconfig/usb anymore, use /etc/sysconfig/hotplug
  instead
- better check if usb was successfully activated
- wait up to 3 seconds for active usb events
- add two new /etc/sysconfig/hotplug variables:
* use HOTPLUG_USB_HOSTCONTROLLER_LIST to load a fixed list of host
  controller drivers
* use HOTPLUG_USB_STATIC_MODULES to load a fixed list of drivers
  (for input)

Index: etc/hotplug/usb.rc
=================================--- etc/hotplug/usb.rc	(revision 15)
+++ etc/hotplug/usb.rc	(revision 16)
@@ -21,9 +21,6 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-STATIC_MODULE_LIST-X11_USBMICE_HACKúlse
-
 # source function library
 if [ -f /etc/init.d/functions ]; then
 	. /etc/init.d/functions
@@ -31,22 +28,6 @@
 	. /etc/rc.d/init.d/functions
 fi
 
-
-# override any of the defaults above?
-if [ -f /etc/sysconfig/usb ]; then
-    . /etc/sysconfig/usb
-fi
-
-
-MOUSE_MODULES="mousedev input"
-
-# In its currently-recommended configuration, XFree86 3.3.6 always opens
-# /dev/input/mice; so mousedev and input must be loaded before X11 starts.
-if [ $X11_USBMICE_HACK = true ]; then
-    STATIC_MODULE_LIST="$MOUSE_MODULES $STATIC_MODULE_LIST"
-fi
-
-
 #
 # "COLD PLUG" ... recovery from partial USB init that may have happened
 # before the OS could really handle hotplug, perhaps because /sbin or
@@ -109,8 +90,7 @@
 
 maybe_start_usb ()
 {
-    local COUNT SYNTHESIZE
-    COUNT=0
+    local SYNTHESIZE
 
     # if USB is partially initted then synthesize "cold plug" events. the
     # kernel probably dropped many "hot plug" events, and those it didn't
@@ -154,32 +134,16 @@
     # FIXME: some of this should be driven by PCI hotplugging, and have
     # the blacklist control which uhci driver gets used (before 2.5).
 
-    # "new style" HCDs ... more common code
-    modprobe -q ehci-hcd >/dev/null 2>&1
-    modprobe -q ohci-hcd >/dev/null 2>&1
-    modprobe -q uhci-hcd >/dev/null 2>&1
-
-    # "old style" HCDs ... more driver-specific bugs
-    modprobe -q usb-ohci >/dev/null 2>&1
-    # NOTE: this prefers "uhci"; you may prefer "usb-uhci".
-    # modprobe -q usb-uhci >/dev/null 2>&1 || modprobe -q uhci >/dev/null 2>&1
-    modprobe -q uhci >/dev/null 2>&1 || modprobe -q usb-uhci >/dev/null 2>&1
-
-    # ... add any non-PCI HCDS here.  Examples include the
-    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
-    # ohci-hcd can handle some non-pci variants.
+    # Load Host Controller Drivers (HCDs) specified in /etc/sysconfig/hotplug
+    for i in $HOTPLUG_USB_HOSTCONTROLLER_LIST ; do
+	modprobe -q $i >/dev/null 2>&1 && mesg "loaded HCD: $i"
+    done
 
     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.
-	#
-	# NOTE: this fails on older kernels, where usbdevfs had two files
-	# ('devices' and 'drivers') with no hcds registered, but works on
-	# newer kernels where usbfs has zero files until hcds register,
-	# and might not have the 'drivers' file.
-	COUNT=`ls /proc/bus/usb | wc -l`
-	if [ $COUNT -lt 2 ]; then
-	    umount /proc/bus/usb
+	if [ ! -d /proc/bus/usb/001 ] ; then
+	    test -f /proc/bus/usb/devices && umount /proc/bus/usb
 	    rmmod usbcore >/dev/null 2>&1
 	    return 1
 	fi
@@ -199,10 +163,17 @@
 
     # Some modules are statically loaded, perhaps because they are
     # needed to activate filesystem device nodes.
-    for MODULE in $STATIC_MODULE_LIST; do
+    for MODULE in $HOTPLUG_USB_STATIC_MODULES ; do
 	modprobe $MODULE
     done
 
+    # there could be still some active hotplug events
+    # wait for them because other rc scripts may need the drivers
+    sleep 3 & DELAY_PID=$!
+    until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
+    	test -d /proc/$DELAY_PID || break
+    done
+
     # we did everything we could ...
     return 0
 }
Index: etc/sysconfig/hotplug
=================================--- etc/sysconfig/hotplug	(revision 15)
+++ etc/sysconfig/hotplug	(revision 16)
@@ -3,3 +3,16 @@
 # Enable debugging for all hotplug actions? yes/no
 #
 HOTPLUG_DEBUG=no
+#####################################################################
+#
+# The hostcontroller drivers will be probed in that order
+# It is useful for the uhci/usb-uhci battle
+#
+HOTPLUG_USB_HOSTCONTROLLER_LIST="ehci-hcd ohci-hcd uhci-hcd usb-ohci usb-uhci uhci"
+#####################################################################
+#
+# These modules will be loaded when usb hotplug starts. These are at least
+# modules for which no hotplug events is created e.g. input devices
+# If you are going to use old XFree86 3.x you may add 'input'.
+#
+HOTPLUG_USB_STATIC_MODULES="input keybdev evdev joydev mousedev"
-- 
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
@ 2003-06-07 17:51 ` Olaf Hering
  2003-06-07 20:28 ` Wout Mertens
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Olaf Hering @ 2003-06-07 17:51 UTC (permalink / raw)
  To: linux-hotplug


I missed /etc/sysconfig/hotplug in usb.rc, fixed patch:

- do not use /etc/sysconfig/usb anymore, use /etc/sysconfig/hotplug
  instead
- better check if usb was successfully activated
- wait up to 3 seconds for active usb events
- add two new /etc/sysconfig/hotplug variables:
* use HOTPLUG_USB_HOSTCONTROLLER_LIST to load a fixed list of host
  controller drivers
* use HOTPLUG_USB_STATIC_MODULES to load a fixed list of drivers
  (for input)

Index: etc/hotplug/usb.rc
=================================--- etc/hotplug/usb.rc	(revision 15)
+++ etc/hotplug/usb.rc	(revision 17)
@@ -21,9 +21,6 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-STATIC_MODULE_LIST-X11_USBMICE_HACKúlse
-
 # source function library
 if [ -f /etc/init.d/functions ]; then
 	. /etc/init.d/functions
@@ -31,22 +28,10 @@
 	. /etc/rc.d/init.d/functions
 fi
 
-
-# override any of the defaults above?
-if [ -f /etc/sysconfig/usb ]; then
-    . /etc/sysconfig/usb
-fi
-
-
-MOUSE_MODULES="mousedev input"
-
-# In its currently-recommended configuration, XFree86 3.3.6 always opens
-# /dev/input/mice; so mousedev and input must be loaded before X11 starts.
-if [ $X11_USBMICE_HACK = true ]; then
-    STATIC_MODULE_LIST="$MOUSE_MODULES $STATIC_MODULE_LIST"
+if [ -f /etc/sysconfig/hotplug ]; then
+    . /etc/sysconfig/hotplug
 fi
 
-
 #
 # "COLD PLUG" ... recovery from partial USB init that may have happened
 # before the OS could really handle hotplug, perhaps because /sbin or
@@ -109,8 +94,7 @@
 
 maybe_start_usb ()
 {
-    local COUNT SYNTHESIZE
-    COUNT=0
+    local SYNTHESIZE
 
     # if USB is partially initted then synthesize "cold plug" events. the
     # kernel probably dropped many "hot plug" events, and those it didn't
@@ -154,32 +138,16 @@
     # FIXME: some of this should be driven by PCI hotplugging, and have
     # the blacklist control which uhci driver gets used (before 2.5).
 
-    # "new style" HCDs ... more common code
-    modprobe -q ehci-hcd >/dev/null 2>&1
-    modprobe -q ohci-hcd >/dev/null 2>&1
-    modprobe -q uhci-hcd >/dev/null 2>&1
-
-    # "old style" HCDs ... more driver-specific bugs
-    modprobe -q usb-ohci >/dev/null 2>&1
-    # NOTE: this prefers "uhci"; you may prefer "usb-uhci".
-    # modprobe -q usb-uhci >/dev/null 2>&1 || modprobe -q uhci >/dev/null 2>&1
-    modprobe -q uhci >/dev/null 2>&1 || modprobe -q usb-uhci >/dev/null 2>&1
-
-    # ... add any non-PCI HCDS here.  Examples include the
-    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
-    # ohci-hcd can handle some non-pci variants.
+    # Load Host Controller Drivers (HCDs) specified in /etc/sysconfig/hotplug
+    for i in $HOTPLUG_USB_HOSTCONTROLLER_LIST ; do
+	modprobe -q $i >/dev/null 2>&1 && mesg "loaded HCD: $i"
+    done
 
     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.
-	#
-	# NOTE: this fails on older kernels, where usbdevfs had two files
-	# ('devices' and 'drivers') with no hcds registered, but works on
-	# newer kernels where usbfs has zero files until hcds register,
-	# and might not have the 'drivers' file.
-	COUNT=`ls /proc/bus/usb | wc -l`
-	if [ $COUNT -lt 2 ]; then
-	    umount /proc/bus/usb
+	if [ ! -d /proc/bus/usb/001 ] ; then
+	    test -f /proc/bus/usb/devices && umount /proc/bus/usb
 	    rmmod usbcore >/dev/null 2>&1
 	    return 1
 	fi
@@ -199,10 +167,17 @@
 
     # Some modules are statically loaded, perhaps because they are
     # needed to activate filesystem device nodes.
-    for MODULE in $STATIC_MODULE_LIST; do
+    for MODULE in $HOTPLUG_USB_STATIC_MODULES ; do
 	modprobe $MODULE
     done
 
+    # there could be still some active hotplug events
+    # wait for them because other rc scripts may need the drivers
+    sleep 3 & DELAY_PID=$!
+    until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
+    	test -d /proc/$DELAY_PID || break
+    done
+
     # we did everything we could ...
     return 0
 }
Index: etc/sysconfig/hotplug
=================================--- etc/sysconfig/hotplug	(revision 15)
+++ etc/sysconfig/hotplug	(revision 17)
@@ -3,3 +3,16 @@
 # Enable debugging for all hotplug actions? yes/no
 #
 HOTPLUG_DEBUG=no
+#####################################################################
+#
+# The hostcontroller drivers will be probed in that order
+# It is useful for the uhci/usb-uhci battle
+#
+HOTPLUG_USB_HOSTCONTROLLER_LIST="ehci-hcd ohci-hcd uhci-hcd usb-ohci usb-uhci uhci"
+#####################################################################
+#
+# These modules will be loaded when usb hotplug starts. These are at least
+# modules for which no hotplug events is created e.g. input devices
+# If you are going to use old XFree86 3.x you may add 'input'.
+#
+HOTPLUG_USB_STATIC_MODULES="input keybdev evdev joydev mousedev"
-- 
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
  2003-06-07 17:51 ` Olaf Hering
@ 2003-06-07 20:28 ` Wout Mertens
  2003-06-08  5:42 ` Olaf Hering
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Wout Mertens @ 2003-06-07 20:28 UTC (permalink / raw)
  To: linux-hotplug

Hi Olaf,

Is the waiting absolutely necessary?

Could it be shorter? Or could you make it only do that during coldplug
phase?

The reason I'm asking is because I use my USB memory key to log in, and
that needs to wait 3 seconds (I patch it out of course) for no reason
whatsoever.

Thanks,

Wout.

On Sat, 7 Jun 2003, Olaf Hering wrote:

>
> I missed /etc/sysconfig/hotplug in usb.rc, fixed patch:
>
> - do not use /etc/sysconfig/usb anymore, use /etc/sysconfig/hotplug
>   instead
> - better check if usb was successfully activated
> - wait up to 3 seconds for active usb events
> - add two new /etc/sysconfig/hotplug variables:
> * use HOTPLUG_USB_HOSTCONTROLLER_LIST to load a fixed list of host
>   controller drivers
> * use HOTPLUG_USB_STATIC_MODULES to load a fixed list of drivers
>   (for input)
>
> Index: etc/hotplug/usb.rc
> =================================> --- etc/hotplug/usb.rc	(revision 15)
> +++ etc/hotplug/usb.rc	(revision 17)
> @@ -21,9 +21,6 @@
>
>  PATH=/sbin:/bin:/usr/sbin:/usr/bin
>
> -STATIC_MODULE_LIST> -X11_USBMICE_HACKúlse
> -
>  # source function library
>  if [ -f /etc/init.d/functions ]; then
>  	. /etc/init.d/functions
> @@ -31,22 +28,10 @@
>  	. /etc/rc.d/init.d/functions
>  fi
>
> -
> -# override any of the defaults above?
> -if [ -f /etc/sysconfig/usb ]; then
> -    . /etc/sysconfig/usb
> -fi
> -
> -
> -MOUSE_MODULES="mousedev input"
> -
> -# In its currently-recommended configuration, XFree86 3.3.6 always opens
> -# /dev/input/mice; so mousedev and input must be loaded before X11 starts.
> -if [ $X11_USBMICE_HACK = true ]; then
> -    STATIC_MODULE_LIST="$MOUSE_MODULES $STATIC_MODULE_LIST"
> +if [ -f /etc/sysconfig/hotplug ]; then
> +    . /etc/sysconfig/hotplug
>  fi
>
> -
>  #
>  # "COLD PLUG" ... recovery from partial USB init that may have happened
>  # before the OS could really handle hotplug, perhaps because /sbin or
> @@ -109,8 +94,7 @@
>
>  maybe_start_usb ()
>  {
> -    local COUNT SYNTHESIZE
> -    COUNT=0
> +    local SYNTHESIZE
>
>      # if USB is partially initted then synthesize "cold plug" events. the
>      # kernel probably dropped many "hot plug" events, and those it didn't
> @@ -154,32 +138,16 @@
>      # FIXME: some of this should be driven by PCI hotplugging, and have
>      # the blacklist control which uhci driver gets used (before 2.5).
>
> -    # "new style" HCDs ... more common code
> -    modprobe -q ehci-hcd >/dev/null 2>&1
> -    modprobe -q ohci-hcd >/dev/null 2>&1
> -    modprobe -q uhci-hcd >/dev/null 2>&1
> -
> -    # "old style" HCDs ... more driver-specific bugs
> -    modprobe -q usb-ohci >/dev/null 2>&1
> -    # NOTE: this prefers "uhci"; you may prefer "usb-uhci".
> -    # modprobe -q usb-uhci >/dev/null 2>&1 || modprobe -q uhci >/dev/null 2>&1
> -    modprobe -q uhci >/dev/null 2>&1 || modprobe -q usb-uhci >/dev/null 2>&1
> -
> -    # ... add any non-PCI HCDS here.  Examples include the
> -    # CRIS usb-host, Philips ISP-1161, Symlogic 811HS, and so on.
> -    # ohci-hcd can handle some non-pci variants.
> +    # Load Host Controller Drivers (HCDs) specified in /etc/sysconfig/hotplug
> +    for i in $HOTPLUG_USB_HOSTCONTROLLER_LIST ; do
> +	modprobe -q $i >/dev/null 2>&1 && mesg "loaded HCD: $i"
> +    done
>
>      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.
> -	#
> -	# NOTE: this fails on older kernels, where usbdevfs had two files
> -	# ('devices' and 'drivers') with no hcds registered, but works on
> -	# newer kernels where usbfs has zero files until hcds register,
> -	# and might not have the 'drivers' file.
> -	COUNT=`ls /proc/bus/usb | wc -l`
> -	if [ $COUNT -lt 2 ]; then
> -	    umount /proc/bus/usb
> +	if [ ! -d /proc/bus/usb/001 ] ; then
> +	    test -f /proc/bus/usb/devices && umount /proc/bus/usb
>  	    rmmod usbcore >/dev/null 2>&1
>  	    return 1
>  	fi
> @@ -199,10 +167,17 @@
>
>      # Some modules are statically loaded, perhaps because they are
>      # needed to activate filesystem device nodes.
> -    for MODULE in $STATIC_MODULE_LIST; do
> +    for MODULE in $HOTPLUG_USB_STATIC_MODULES ; do
>  	modprobe $MODULE
>      done
>
> +    # there could be still some active hotplug events
> +    # wait for them because other rc scripts may need the drivers
> +    sleep 3 & DELAY_PID=$!
> +    until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
> +    	test -d /proc/$DELAY_PID || break
> +    done
> +
>      # we did everything we could ...
>      return 0
>  }
> Index: etc/sysconfig/hotplug
> =================================> --- etc/sysconfig/hotplug	(revision 15)
> +++ etc/sysconfig/hotplug	(revision 17)
> @@ -3,3 +3,16 @@
>  # Enable debugging for all hotplug actions? yes/no
>  #
>  HOTPLUG_DEBUG=no
> +#####################################################################
> +#
> +# The hostcontroller drivers will be probed in that order
> +# It is useful for the uhci/usb-uhci battle
> +#
> +HOTPLUG_USB_HOSTCONTROLLER_LIST="ehci-hcd ohci-hcd uhci-hcd usb-ohci usb-uhci uhci"
> +#####################################################################
> +#
> +# These modules will be loaded when usb hotplug starts. These are at least
> +# modules for which no hotplug events is created e.g. input devices
> +# If you are going to use old XFree86 3.x you may add 'input'.
> +#
> +HOTPLUG_USB_STATIC_MODULES="input keybdev evdev joydev mousedev"
> --
> USB is for mice, FireWire is for men!
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
> thread debugger on the planet. Designed with thread debugging features
> you've never dreamed of, try TotalView 6 free at www.etnus.com.
> _______________________________________________
> Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
> Linux-hotplug-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
>


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
  2003-06-07 17:51 ` Olaf Hering
  2003-06-07 20:28 ` Wout Mertens
@ 2003-06-08  5:42 ` Olaf Hering
  2003-06-08 19:11 ` David Brownell
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Olaf Hering @ 2003-06-08  5:42 UTC (permalink / raw)
  To: linux-hotplug

 On Sat, Jun 07, Wout Mertens wrote:

> Hi Olaf,
> 
> Is the waiting absolutely necessary?
> 
> Could it be shorter? Or could you make it only do that during coldplug
> phase?
> 
> The reason I'm asking is because I use my USB memory key to log in, and
> that needs to wait 3 seconds (I patch it out of course) for no reason
> whatsoever.

You mean you need the sleep 3 or you do not need the sleep 3?
And with the current way, a 3 seonds delay will happen anyway, with the
patch it will only wait 1 second for the first event.

If you are worried about usb.rc, there will be no delay if the events
are already finished. I'm not sure if we should wait for all background
events before proceeding. A little testing shows that it could take up
to 30 seconds, depending on the amound and kind of connected USB
devices. Really slow hid devices are a pain...

We could improve things alot if /proc/bus/usb/devices had a better
design :(
It is updated dynamically, reading it can take an unknown amount of time
and it triggers bus traffic. You can not do 
grep -Eq '^I: .* Driver=\(none\)$' /proc/bus/usb/devices
Alot bus traffic could be avoided if the content would be static, no
poking with usbmodules needed if there is no device without a driver ->
no delay needed at all in such a case. There are probably ways in 2.5 to
check for devices without drivers in /sys, but I have not verified it.

-rw-r--r--    1 root     root          225 2003-06-08 07:26:57.000000000 +0200 /tmp/a
-rw-r--r--    1 root     root         3022 2003-06-08 07:27:01.000000000 +0200 /tmp/b
-rw-r--r--    1 root     root          980 2003-06-08 07:27:26.000000000 +0200 /tmp/c

This was my test patch:

     # there could be still some active hotplug events
     # wait for them because other rc scripts may need the drivers
+    echo /var/run/usb/*.queue.* > /tmp/a
     sleep 3 & DELAY_PID=$!
     until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
        test -d /proc/$DELAY_PID || break
     done
+    echo /var/run/usb/*.queue.* > /tmp/b
+    ps axf >> /tmp/b
+    until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
+       sleep 1
+    done
+    echo /var/run/usb/*.queue.* > /tmp/c
+    ps axf >> /tmp/c


> > +    # there could be still some active hotplug events
> > +    # wait for them because other rc scripts may need the drivers
> > +    sleep 3 & DELAY_PID=$!
> > +    until [ "`ls /var/run/usb/*.queue.* 2>/dev/null`" = "" ] ; do
> > +    	test -d /proc/$DELAY_PID || break
> > +    done

-- 
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
                   ` (2 preceding siblings ...)
  2003-06-08  5:42 ` Olaf Hering
@ 2003-06-08 19:11 ` David Brownell
  2003-06-10 21:30 ` Olaf Hering
  2003-06-11  0:19 ` David Brownell
  5 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2003-06-08 19:11 UTC (permalink / raw)
  To: linux-hotplug

Olaf Hering wrote:

 > We could improve things alot if /proc/bus/usb/devices had a better
 > design :(

Well, that was a first version.  Nobody's really done
much with that kernel code other than fix bugs.


 > It is updated dynamically, reading it can take an unknown amount of time
 > and it triggers bus traffic. You can not do
 > grep -Eq '^I: .* Driver=\(none\)$' /proc/bus/usb/devices

No, but you could open every /proc/bus/usb/BBB/DDD file,
read its descriptors, and then ask each interface what
driver bound to it ... the answer may be "none".

If indeed /proc/bus/usb is available ... which hotplug
has never assumed.

- Dave






-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
                   ` (3 preceding siblings ...)
  2003-06-08 19:11 ` David Brownell
@ 2003-06-10 21:30 ` Olaf Hering
  2003-06-11  0:19 ` David Brownell
  5 siblings, 0 replies; 7+ messages in thread
From: Olaf Hering @ 2003-06-10 21:30 UTC (permalink / raw)
  To: linux-hotplug

 On Sat, Jun 07, Olaf Hering wrote:

> Index: etc/hotplug/usb.rc
> @@ -154,32 +134,16 @@
>      # FIXME: some of this should be driven by PCI hotplugging, and have
>      # the blacklist control which uhci driver gets used (before 2.5).

This comment looks like a chicken/egg problem.
if you load the usb hostcontroller drivers via pci.rc then we will lose
the real hotplug events because usbfs is not mounted.
We can still syntesize stuff, but thats probably not what hotplugging
means?
Has anyone looked into this?


Gruss Olaf

-- 
USB is for mice, FireWire is for men!


-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: [PATCH] hotplug usb.rc changes
  2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
                   ` (4 preceding siblings ...)
  2003-06-10 21:30 ` Olaf Hering
@ 2003-06-11  0:19 ` David Brownell
  5 siblings, 0 replies; 7+ messages in thread
From: David Brownell @ 2003-06-11  0:19 UTC (permalink / raw)
  To: linux-hotplug

Olaf Hering wrote:
>  On Sat, Jun 07, Olaf Hering wrote:
> 
> 
>>Index: etc/hotplug/usb.rc
>>@@ -154,32 +134,16 @@
>>     # FIXME: some of this should be driven by PCI hotplugging, and have
>>     # the blacklist control which uhci driver gets used (before 2.5).
> 
> 
> This comment looks like a chicken/egg problem.
> if you load the usb hostcontroller drivers via pci.rc then we will lose
> the real hotplug events because usbfs is not mounted.

Unless something guarantees the "mount /proc/bus/usb" step gets
done after "usbcore" loads.  There are modules.conf and modprobe.conf
ways to do that ... or doing it in "usb.rc" while bringing USB up,
as is done here, not pretty but reasonably robust.


> We can still syntesize stuff, but thats probably not what hotplugging
> means?

If "usbcore" is live, then real hotplugging events will happen.

But they may not be all that useful ... if a USB keyboard needs
to be available early, that means hotplug events happen early.
Even before filesystems are mounted or networks are up, so
the more interesting hotplug agents can't do their work.

If nothing else, a "coldplug" synthesis phase later on will
make sure that the agents will be called when most system
resources are available.


> Has anyone looked into this?

Not lately.


- Dave




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2003-06-11  0:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-07 16:56 [PATCH] hotplug usb.rc changes Olaf Hering
2003-06-07 17:51 ` Olaf Hering
2003-06-07 20:28 ` Wout Mertens
2003-06-08  5:42 ` Olaf Hering
2003-06-08 19:11 ` David Brownell
2003-06-10 21:30 ` Olaf Hering
2003-06-11  0:19 ` David Brownell

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).