View Single Post
Old 11-08-2012, 06:45 PM   #18
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,983
Karma: 4501011
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
To expand a bit on the issue:

* USBNet relies on volumd to toggle between USBMS/USBNET.
* volumd uses modprobe to remove & load the usb gadgets.
* On remove, modprobe will try to unload the parent modules of the removed module if they're unused.
* As a consequence, depending on the device, if the device is plugged in, modprobe will fail either on remove or load with a 'Device or resource busy' error. (Which, AFAICT, is completely true & valid).

Now, USBNet does a bunch of safety checks (namely, waiting for usb0 to come up before calling ifconfig to set a custom IP). Simple_usbnet just called volumd (through lipc), and let the system handle it. Apparently, if you leave it alone long enough, it *does* end up coming up properly (on volumd's terms), so that was mostly transparent on simple_usbnet (although, you'd have to actually unplug the device too to make the switch effective). USBNet, ont the other hand, *needs* stuff to look okay *during* the lifetime of its helper script, so it'll wait for 15s for usb0 to come up, and throw that error and give up after that. After that, it's basically undefined behaviour. usb0 might come up properly (on volumd's terms), or not .

I didn't use simple_usbnet much, and I'm used to this limitation from the K2/3, so I never looked too deeply into it at the time, because I was avoiding it, but if someone can confirm that simple_usbnet handled toggling while plugged in slightly better, I can add a setting that bypasses those checks (and duplicate simple_usbnet's behavior). That means losing the custom IP (if the setting is enabled), but since we default to the same settings as volumd, that's not terribly annoying...

Last edited by NiLuJe; 11-08-2012 at 07:04 PM.
NiLuJe is offline   Reply With Quote