linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb cold plugging
@ 2004-03-14 17:58 Fumitoshi UKAI
  2004-03-26 23:15 ` Greg KH
  2004-03-27  7:56 ` Fumitoshi UKAI
  0 siblings, 2 replies; 3+ messages in thread
From: Fumitoshi UKAI @ 2004-03-14 17:58 UTC (permalink / raw)
  To: linux-hotplug

Hi,

It seems there are some problems in usb coldplugging.

1) after usb core modules loaded, it needs some time to propagate
  information to /proc or /sys. So, I think we need some wait before
  calling usb_boot_events.
  But I'm not sure it is sufficient to sleep 1 sec. are there any 
  better way to wait some files in /proc or /sys ?

2) if /sys/bus/usb/devices found, it updates DEVPATH and PRODUCT, but
   it never call /etc/hotplug/usb.agent, so no coldplugging happens.

Is this patch ok to commit?

diff -ruN hotplug-2004_03_11.orig/etc/hotplug/usb.rc hotplug-2004_03_11/etc/hotplug/usb.rc
--- hotplug-2004_03_11.orig/etc/hotplug/usb.rc	2004-03-15 01:44:51.000000000 +0900
+++ hotplug-2004_03_11/etc/hotplug/usb.rc	2004-03-15 01:44:26.000000000 +0900
@@ -103,13 +103,9 @@
 	    for device in /sys/bus/usb/devices/[0-9]*; do
 		DEVPATH=${device#/sys/}
 		if [ -f $device/idVendor ]; then
-		     PRODUCT="`cat $device/idVendor`/`cat $device/idProduct`/`cat $device/bcdDevice`"
-#		    class=`cat $device/bDeviceClass`
-#		    TYPE="$class/`cat $device/bDeviceSubClass`/`cat $device/bDeviceProtocol`"
+		     PRODUCT="$(cat $device/idVendor)/$(cat $device/idProduct)/$(cat $device/bcdDevice)"
+		     /etc/hotplug/usb.agent
 		fi
-#		if [ "$class" -eq 0 -a -f $device/bInterfaceClass ]; then
-#		    INTERFACE="`cat $device/bInterfaceClass`/`cat $device/bInterfaceSubClass`/`cat $device/bInterfaceProtocol`"
-#		fi
 	    done
 	else
 	    for DEVICE in /proc/bus/usb/*/*; do
@@ -208,6 +204,7 @@
     # cope with devices that enumerated earlier
     # and may not have been fully configured.
     if [ $SYNTHESIZE = true ]; then
+	sleep 1
     	usb_boot_events
     fi
 

Thanks,
Fumitoshi UKAI


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
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] 3+ messages in thread

* Re: usb cold plugging
  2004-03-14 17:58 usb cold plugging Fumitoshi UKAI
@ 2004-03-26 23:15 ` Greg KH
  2004-03-27  7:56 ` Fumitoshi UKAI
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-03-26 23:15 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Mar 15, 2004 at 02:58:40AM +0900, Fumitoshi UKAI wrote:
> Hi,
> 
> It seems there are some problems in usb coldplugging.
> 
> 1) after usb core modules loaded, it needs some time to propagate
>   information to /proc or /sys. So, I think we need some wait before
>   calling usb_boot_events.
>   But I'm not sure it is sufficient to sleep 1 sec. are there any 
>   better way to wait some files in /proc or /sys ?

Sure, you can wait until the specific bus files show up under
/sys/bus/BUS_TYPE

> 2) if /sys/bus/usb/devices found, it updates DEVPATH and PRODUCT, but
>    it never call /etc/hotplug/usb.agent, so no coldplugging happens.

That's not good.

> Is this patch ok to commit?

Looks good to me for now.  The sleep thing can't hurt :)

Feel free to commit it.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
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] 3+ messages in thread

* Re: usb cold plugging
  2004-03-14 17:58 usb cold plugging Fumitoshi UKAI
  2004-03-26 23:15 ` Greg KH
@ 2004-03-27  7:56 ` Fumitoshi UKAI
  1 sibling, 0 replies; 3+ messages in thread
From: Fumitoshi UKAI @ 2004-03-27  7:56 UTC (permalink / raw)
  To: linux-hotplug

At Fri, 26 Mar 2004 15:15:31 -0800,
Greg KH wrote:
> 
> On Mon, Mar 15, 2004 at 02:58:40AM +0900, Fumitoshi UKAI wrote:
> > Hi,
> > 
> > It seems there are some problems in usb coldplugging.
> > 
> > 1) after usb core modules loaded, it needs some time to propagate
> >   information to /proc or /sys. So, I think we need some wait before
> >   calling usb_boot_events.
> >   But I'm not sure it is sufficient to sleep 1 sec. are there any 
> >   better way to wait some files in /proc or /sys ?
> 
> Sure, you can wait until the specific bus files show up under
> /sys/bus/BUS_TYPE
> 
> > 2) if /sys/bus/usb/devices found, it updates DEVPATH and PRODUCT, but
> >    it never call /etc/hotplug/usb.agent, so no coldplugging happens.
> 
> That's not good.
> 
> > Is this patch ok to commit?
> 
> Looks good to me for now.  The sleep thing can't hurt :)
> 
> Feel free to commit it.

Ok, commited.

thanks,
Fumitoshi UKAI


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2004-03-27  7:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-14 17:58 usb cold plugging Fumitoshi UKAI
2004-03-26 23:15 ` Greg KH
2004-03-27  7:56 ` Fumitoshi UKAI

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