Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 254997 - [2.6.27 regression] data transfer via /dev/ttyUSB to garmin hangs kernel
Summary: [2.6.27 regression] data transfer via /dev/ttyUSB to garmin hangs kernel
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard: linux-bugzilla-pending
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 01:37 UTC by Andre Hinrichs
Modified: 2009-01-17 13:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,4.30 KB, text/plain)
2009-01-15 01:38 UTC, Andre Hinrichs
Details
dmesg after starting transfer (dmesg.after,30.06 KB, text/plain)
2009-01-15 10:14 UTC, Andre Hinrichs
Details
kernel config (.config,52.09 KB, text/plain)
2009-01-15 10:15 UTC, Andre Hinrichs
Details
the requested kernel log (kernellog.txt,29.95 KB, text/plain)
2009-01-17 10:50 UTC, Andre Hinrichs
Details
dmesg usb debug (kernellog-usb-debug.txt,30.35 KB, text/plain)
2009-01-17 12:38 UTC, Andre Hinrichs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Hinrichs 2009-01-15 01:37:20 UTC
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
Comment 1 Andre Hinrichs 2009-01-15 01:38:30 UTC
Created attachment 178534 [details]
emerge --info
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-15 02:47:46 UTC
Does version >=2.6.28 fix the issue?
Comment 3 George Kadianakis (RETIRED) gentoo-dev 2009-01-15 03:01:34 UTC
Could we have a copy of your dmesg after the hang of gpsbabel and a copy of your kernel config as well?
Comment 4 Andre Hinrichs 2009-01-15 10:14:12 UTC
Created attachment 178565 [details]
dmesg after starting transfer
Comment 5 Andre Hinrichs 2009-01-15 10:15:03 UTC
Created attachment 178566 [details]
kernel config
Comment 6 Andre Hinrichs 2009-01-15 10:20:34 UTC
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
Comment 7 Sergey Ovcharenko 2009-01-15 12:28:49 UTC
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
Comment 8 Andre Hinrichs 2009-01-15 15:21:52 UTC
Thanks for the hint. I've switched to the direct usb: support of gpsbabel which works fine with newer kernels.
Anyway, the issue remains...
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2009-01-16 23:46:28 UTC
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!
Comment 10 Andre Hinrichs 2009-01-17 10:50:18 UTC
Created attachment 178774 [details]
the requested kernel log
Comment 11 Daniel Drake (RETIRED) gentoo-dev 2009-01-17 11:49:17 UTC
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.
Comment 12 Andre Hinrichs 2009-01-17 12:38:03 UTC
Created attachment 178782 [details]
dmesg usb debug
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2009-01-17 12:55:22 UTC
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.
Comment 14 Daniel Drake (RETIRED) gentoo-dev 2009-01-17 13:26:34 UTC
actually, please correct the above to say "2.6.27 regression, 2.6.26 worked"