Automatic Activation, Hotplug and UDEV, Configuration
Post Reply
linuxgeek
Posts: 4
Joined: 19 Jul 2011, 21:38
Location: United States

SOLVED: Everything works, but only in debug mode

Post by linuxgeek » 19 Jul 2011, 21:42

I'm using kernel 2.6.24, udev version 100, usb-modeswitch v.1.1.7.

Everything works automatically only if I have udev running in debug mode and I have usb-modeswitch logging turned on. If either of those are NOT turned on, usb-modeswitch only works by invoking it manually.

Any suggestions on why this is happening?
Last edited by linuxgeek on 20 Jul 2011, 21:43, edited 1 time in total.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 19 Jul 2011, 23:30

Sorry, no idea, except that kernel and udev are a bit dated. There were many bug fixes in udev since that version. I believe the version is now in the 160 range ...

linuxgeek
Posts: 4
Joined: 19 Jul 2011, 21:38
Location: United States

Post by linuxgeek » 19 Jul 2011, 23:54

I've got this running on an embedded processor and for code base reasons we just can't keep changing kernel versions. So really this is what I have to work with.

As far as udev, upgrading that is tricky as well because it relies on kernel headers that may or may not exist for the kernel version we're running. Getting a newer version to build may not work.

A lot of times on embedded systems we see situations like this where if you are writing things to the terminal such as during debugging that the timing changes enough to make things work. I'm guessing that's maybe what's going on here but I don't know what kind of timing that would be. Time for the device to settle?

That's the part I might need help solving.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 20 Jul 2011, 00:16

If you suspect timing reasons, you could try to insert "after" commands in the dispatcher script. They work like "sleep" statements in bash, but take milliseconds as parameters.

"after 500" will wait for half a second.

The dispatcher is named "usb_modeswitch.tcl" before installing; it will be copied to
"/usr/sbin/usb_modeswitch_dispatcher".


linuxgeek
Posts: 4
Joined: 19 Jul 2011, 21:38
Location: United States

Post by linuxgeek » 20 Jul 2011, 08:07

I believe its on the udev side, since when I run only it in debug mode, I can see that usb-modeswitch never gets kicked off. I have substituted other test programs in its place as well and they don't run either.

Still baffling.

BTW: I got udev version 135 to build and it behaves the same as version 100. Significantly newer with same results.

linuxgeek
Posts: 4
Joined: 19 Jul 2011, 21:38
Location: United States

Post by linuxgeek » 20 Jul 2011, 21:14

Got things working, finally.

I introduced a 1000 ms delay in udev itself, right between the point where it gets kernel notification and it runs off and does something.

Thanks for your help Josh.

Josh
Site Admin
Posts: 6593
Joined: 03 Nov 2007, 00:30

Post by Josh » 21 Jul 2011, 00:13

Well, I didn't really do anything ...

Post Reply