I have a Garmin etrex Legend HCx GPS device and am using gpsbabel to transfer data from/to the Garmin device through /dev/ttyUSB0. garmin_gps is compiled as a module in the linux kernel (couldn't find a way to compile it directly into the kernel). Until kernel version 2.6.26 everything was fine. Since kernel version 2.6.27 data transfer through /dev/ttyUSB hangs completely. gpsbabel, which I use to transfer data, is not even killable with signal 9. I've tried all kernel versions since 2.6.27 with both vanilla and gentoo-sources without success. Pulling the plug to the garmin device does not bring the ttyUSB down. Trying to remove the module with rmmod -f causes rmmod to hang also. Rest of the system is not affected even if the transfer hangs. But since I am havily using the garmin device I'm stuck to kernel version 2.6.26. emerge --info will be attached to this bug immediately. Here is some system info: # ls -l /dev/ttyUSB0 crw-rw---- 1 root uucp 188, 0 2009-01-15 02:29 /dev/ttyUSB0 # lsmod Module Size Used by garmin_gps 16324 0 usbserial 25820 1 garmin_gps lib80211_crypt_ccmp 5696 3 ipw2200 124916 0 libipw 25348 1 ipw2200 i2c_i801 8720 0 lib80211 4992 3 lib80211_crypt_ccmp,ipw2200,libipw video 17040 0 nfs 238984 0 auth_rpcgss 33088 1 nfs lockd 64552 1 nfs sunrpc 163388 3 nfs,auth_rpcgss,lockd sbp2 20812 0 ohci1394 28784 0 ieee1394 73784 2 sbp2,ohci1394 usbhid 31136 0 uhci_hcd 30096 0 usb_storage 75520 0 ehci_hcd 46416 0 usbcore 138352 7 garmin_gps,usbserial,usbhid,uhci_hcd,usb_storage,ehci_hcd sx8 14860 0 sg 23600 0 scsi_wait_scan 1088 0
Created attachment 178534 [details] emerge --info
Does version >=2.6.28 fix the issue?
Could we have a copy of your dmesg after the hang of gpsbabel and a copy of your kernel config as well?
Created attachment 178565 [details] dmesg after starting transfer
Created attachment 178566 [details] kernel config
Here is the list of kernels I've tried all without success: sys-kernel/gentoo-sources-2.6.27-r7 sys-kernel/gentoo-sources-2.6.28 sys-kernel/vanilla-sources-2.6.28 sys-kernel/vanilla-sources-2.6.29_rc1 Additionally here is a diff of dmesg before and after the start of the transfer: --- dmesg.before 2009-01-15 11:04:56.000000000 +0100 +++ dmesg.after 2009-01-15 11:08:00.000000000 +0100 @@ -1,7 +1,4 @@ -ng -hpet clockevent registered -hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 -hpet0: 3 64-bit timers, 14318180 Hz +timers, 14318180 Hz system 00:00: iomem range 0x0-0x9ffff could not be reserved system 00:00: iomem range 0xc0000-0xc3fff could not be reserved system 00:00: iomem range 0xc4000-0xc7fff could not be reserved @@ -663,3 +660,5 @@ Adding 4195792k swap on /dev/sda4. Priority:-1 extents:1 across:4195792k Adding 1958000k swap on /dev/sda5. Priority:-2 extents:1 across:1958000k uhci_hcd 0000:00:1d.1: reserve dev 2 ep81-INT, period 8, phase 4, 93 us +usb 1-3.3: unlink qh1-1c02/f7bcf500 start 0 [1/3 us] +garmin_gps 1-3.3:1.0: forced unbind
It looks like a common issue,someone even reported it to linux-usb: http://kerneltrap.org/mailarchive/linux-usb/2008/11/16/4135424 but got no reply. Btw gpsbabel has it's own usb support and you don't have to use garmin_gps to access your device: http://wiki.openstreetmap.org/wiki/USB_Garmin_on_GNU/Linux#Using_GPSBabel
Thanks for the hint. I've switched to the direct usb: support of gpsbabel which works fine with newer kernels. Anyway, the issue remains...
Please reproduce the hang, and then immediately run: echo "t" > /proc/sysrq-trigger (pause for 1 second or so) dmesg > kernellog.txt Then attach kernellog.txt here. Thanks!
Created attachment 178774 [details] the requested kernel log
Thanks, that helps. It is a mutex deadlock. Please now enable CONFIG_USB_DEBUG in your kernel, and boot into the new image. Once booted, plug in the device and run (as root): echo 1 > /sys/module/garmin_gps/parameters/debug Then reproduce the hang again (no need to do sysrq stuff this time), and then post dmesg output.
Created attachment 178782 [details] dmesg usb debug
Great, thanks. Please open a bug against the USB serial driver at http://bugzilla.kernel.org. File it against version 2.6.29-rc1, but note that it is a 2.6.28 regression (2.6.27 worked). Attach your latest dmesg attachment here as it shows the hang nicely. I will then contribute more technical details. Please post the new bug URL here when done.
actually, please correct the above to say "2.6.27 regression, 2.6.26 worked"