From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 Description of problem: The hotplug facility is unreliable if a problem occurs loading a module, in this case "visor". If something goes wrong, "visor" and "usbserial" remain loaded preventing reliable operation the next time a hotplug operation is attempted. As it stands there is no /etc/hotplug/usb/visor script by default, so what happens is the visor and usb serial modules are loaded when the hotsync button is pressed. When this operation is finished they are not unloaded. This casuses the procedure to break next time around. Each time, the "device ID" is incremented by 1. Version-Release number of selected component (if applicable): hotplug-2002_04_01-13 kdepim-3.0.5a-1 kernel-2.4.18-14 pilot-link-0.11.8-1 How reproducible: Always Steps to Reproduce: 1. From fresh reboot, as root. 2. Push hotsync button. 3. Run "pilot-xfer -p /dev/usb/ttyUSB1 -l" 4. Wait for process to finish. 5. Repeat steps 2. - 4. Actual Results: After the first time the hotsync button is pressed, the correct modules are loaded and pilot-xfer works as expected. Once the transfer has completed however the modules are not unloaded. The second time around, the pilot-xfer program is unable to correctly talk to the visor and the modules are reloaded. Expected Results: The dump from pilot-xfer should not be sensitive to the number of times the hotsync button is pressed. The modules should cleanly unload when they have served their purpose. Additional info: As a work around I created the following script as /etc/hotplug/usb/visor, based on similar problems reported on the web. ----cut------- #! /bin/sh # # Visor hotplug script. Generates a remover script to make sure that the visor and usbserial # modules are unloaded when the visor is unplugged. # # Ed Grace. PATH=/usr/sbin:$PATH export PATH logger -t visor-hotplug-script "Entering script $0 for (ACTION: ${ACTION})..." # We start all the stuff if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ] then logger -t visor-hotplug-script "Inside my first if statement...." modprobe visor modprobe usbserial # create a remover script if [ "X$REMOVER" != "X" ] then logger -t visor-hotplug-script "Generating remover script ($REMOVER)..." mkdir -p /var/run/usb echo '' > $REMOVER echo '#!/bin/sh' >> $REMOVER echo 'PATH=/usr/sbin:$PATH' >> $REMOVER echo 'export PATH' >> $REMOVER echo 'echo "Entering script $0 for (ACTION: ${ACTION})..."' >> $REMOVER echo 'logger -t visor-remover-script "unloading visor and usbserial modules..." ' >> $REMOVER echo 'rmmod visor' >> $REMOVER echo 'rmmod usbserial' >> $REMOVER chmod +x $REMOVER logger -t visor-hotplug-script "...finished generating remover script" else logger -t visor-hotplug-script-error "...in the remover else? Does this make sense?" fi else logger -t visor-hotplug-script-error "In the else for $0. Does this make sense?" fi logger -t visor-hotplug-script "hotplug script finished..." exit 0 ---paste------ When everything is behaving itself this seems to cure the problem, with the created remover script correctly unloading the modules on disconnect. HOWEVER! If there is _any_ untoward error in the transfer, the same problem occurs, the modules either do not finish getting inserted or are not removed. There is then no way to remove them, /sbin/rmmod bugs out saying that the "resource is busy". When this happens there seems to be no way of restoring normality other than re-booting! I have already tried upgrading the kernel, to no effect.
Why would the modules need to be unloaded?
Hi, thanks for the rapid response.... In principle they probably don't. In practice however it seems empiricaly necessary, as displayed by the supplied "ACTION=REMOVE" workaround script. If they are not unloaded, for some reason pilot-xfer is unable to sucessfully talk to the visor. Could this be due to the device id incrementing? Either way it's sliced or diced there seems to be something going wrong.... -ed
Closing out bugs on older, no longer supported, releases. Apologies for any lack of response. Please reopen if problems persist on more current releases.