Hi everybody!
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

Sep  8 15:56:02 OpenWrt user.notice usb-modeswitch: error obtaining child
information: Inappropriate ioctl for device
Sep  8 15:56:03 OpenWrt user.notice usb-modeswitch: usb_os_find_busses: Found 
001
Sep  8 15:56:03 OpenWrt user.notice usb-modeswitch: usb_os_find_busses: Skipping
non bus directory devices
Sep  8 15:56:03 OpenWrt user.notice usb-modeswitch: usb_os_find_devices: Found
002 on 001
Sep  8 15:56:03 OpenWrt user.notice usb-modeswitch: usb_os_find_devices: Found
001 on 001
Sep  8 15:56:03 OpenWrt user.notice usb-modeswitch: error obtaining child
information: Inappropriate ioctl for device
...

until usb_modeswitch gives up at some point.
calling usb_modeswitch manually works nicely, as then /proc/bus/usb is mounted
and everything is fine.

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

Cheers

Daniel
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to