From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zach Welch Date: Mon, 25 Nov 2002 22:04:39 +0000 Subject: Re: should the module script be invoked every time? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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'. > Which behavour is correct? And if the current behaviour is correct, > then how do I get a script to run every time? Personally, I believe the behaviour you are trying to acheive is correct, and the current behaviour is wrong. However, it's really more a matter of the documentation not clearly stating that you can't name the kernel driver the same as the hotplug script. :-p Thanks for sending this message - I wouldn't have otherwise found the solution today, and I love crossing issues like this off my list. :) Cheers, Zach Welch Superlucidity Services ------------------------------------------------------- This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel