Zach Welch | 25 Nov 2002 23:04

Re: should the module script be invoked every time?

Gene Cash wrote:
 > OK, now what documentation I've seen says that this script should be
 > called *every* time the palm connects on the USB, which it does when
 > it tries to initiate a hotsync.  Is this right?

That's my feeling as well.  In my case, the device must have its
firmware loaded via fxload, but it never works if the kernel module has
alread been loaded.  As a result, these devices never end up connecting
to the kernel driver.  The only workaround I've found is to disconnect
all of those devices, unload its kernel module, then plug all device in
simultaneously.  Yuck!

 > However, due to (I believe) a bug in load_drivers() in
 > hotplug.functions, it only gets called when the visor module is first
 >  loaded, and never called again until that module is unloaded. I can
 > provide a patch.

I just took a glance at that function, and I began to wonder if the
problem stems from the 'if ! lsmod ..' never reaching its body. This
would seem to be caused by the fact that both yours and my hotplug usb
scripts are named the same as their corresponding kernel module. If you
change the userspace script name by adding a '.sh' extension (and update
the associated usermap), I think you will find the problem magically
solved; at least, that has solved my problems.  Hurrah!

Note: if you only have one usermap device entry to update, you probably 
want to call modprobe from within the visor.sh script.  In my case, I 
have two device ids - one is the bare device, the other is provided by 
the newly loaded firmware.  Previously, both usermap entries were named 
'foo', now the pre-renumeration handler is called 'foo.sh'.
(Continue reading)


Gmane