On Wed, 2011-10-19 at 17:22 +0200, Daniel Golle wrote:
> I got a weird problem with usb_modeswitch and coldplugging. Though I somehow
> understand what could be the cause, I have a hard time figuring out a good
> solution....
> So: libusb needs usbfs on /proc/bus/usb, so usb_modeswitch can work only after
> usbfs was mounted at the time of the hotplug(/coldplug) event (or even at the
> time when hotplug2 was started during init?!).
> a device needing modeswitch being already attached during boot results in a 
> loop of
<SNIP>
> delaying the execution of usb_modeswitch by adding 'sleep 30' to
> /etc/hotplug.d/usb/20-usb_modeswitch just before calling usb_modeswitch 
> doesn't
> do the trick, as apparently usb_modeswitch and therefore libusb can see only 
> the
> mounts which were already there at the time of coldplugging...
> 
> possible solutions could be:
> a) load usb-core and mount usbfs before starting hotplug and/or coldplugging 
> any
> devices
> b) check for usb-devices in need of modeswitch independently of hotplug when
> everything else is completed
> c) maybe fix the hotplug2 worker_fork?
> 
> just in case anyone got a good idea, i'd appreciate it :)
> 


I had similar issues and solved it with a post-boot parse of the
USB-tree for the devices I'm interested in. It's ugly, but works if you
are only after coldplug for certain /(known)/ hardware.  

I couldn't find a generic solution that would be acceptable for OpenWRT,
though it'd be preferrable.

//Spider

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to