Hang in ftdi-sio serial driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all, this hang has been around for a long time, possibly more
than 4 years, however probably due to timing changes I can hit this
problem within minutes (vs days or weeks) on 2.6.35 (Ubuntu 10.10). So
it's probably time to fix it. I'm mostly just poking around in the
dark here as I've never looked at linux USB before.

The hardware is hooked up as follows: IRTrans infrared
receiver/display with an integrated FTDI usb-serial converter on
board. To reproduce the hang the irserver daemon simply needs to be
running while using the remote control (and producing data from the
device). The daemon does a select() with a timeout of 10s on the USB
device and then reads whatever bytes are present. In ftdi_sio.c this
seems to cause ftdi_process_read_urb() to poll every 1 ms. Not what I
expected but that's what is going on. The reads eventually stop
returing data. Worse, when you try to exit the application, the
close() syscall to the USB device hangs, apparently there is a
use_count on the urb and it's waiting for a signal that will never
come. This leaves a zombie process and a reboot is required to use the
device again. Fortunately the new kernels have hang detection with
comes in really handy:

Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800137] irserver64    D
0000000000000000     0  2329   2143 0x00000004
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800147]  ffff880056509b98
0000000000000046 ffff880000000000 0000000000015980
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800157]  ffff880056509fd8
0000000000015980 ffff880056509fd8 ffff88005b755b80
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800165]  0000000000015980
0000000000015980 ffff880056509fd8 0000000000015980
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800174] Call Trace:
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800188]
[<ffffffff814070fd>] usb_kill_urb+0x8d/0xd0
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800197]
[<ffffffff8107f610>] ? autoremove_wake_function+0x0/0x40
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800207]
[<ffffffff81036dd9>] ? default_spin_lock_flags+0x9/0x10
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800230]
[<ffffffffa01352e1>] generic_cleanup+0x51/0xe0 [usbserial]
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800244]
[<ffffffffa0135415>] usb_serial_generic_close+0x25/0x60 [usbserial]
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800255]
[<ffffffffa0bf90fa>] ftdi_close+0x3a/0x80 [ftdi_sio]
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800266]
[<ffffffffa013202c>] serial_down+0x2c/0x30 [usbserial]
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800274]
[<ffffffff8135da62>] tty_port_shutdown+0x62/0x70
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800281]
[<ffffffff8135e23d>] tty_port_close+0x2d/0x60
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800292]
[<ffffffffa0132c42>] serial_close+0x42/0x80 [usbserial]
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800301]
[<ffffffff81355cfb>] tty_release+0x17b/0x710
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800310]
[<ffffffff81193509>] ? locks_remove_flock+0x109/0x150
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800319]
[<ffffffff81193b8b>] ? vfs_lock_file+0x3b/0x40
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800328]
[<ffffffff81193c21>] ? locks_remove_posix+0x91/0xc0
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800335]
[<ffffffff815891be>] ? _raw_spin_lock+0xe/0x20
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800343]
[<ffffffff81154245>] __fput+0xf5/0x210
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800350]
[<ffffffff81154385>] fput+0x25/0x30
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800358]
[<ffffffff811508cd>] filp_close+0x5d/0x90
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800367]
[<ffffffff81062b4f>] put_files_struct+0x7f/0xf0
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800375]
[<ffffffff81062c14>] exit_files+0x54/0x70
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800383]
[<ffffffff81065177>] do_exit+0x167/0x3f0
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800391]
[<ffffffff81065455>] do_group_exit+0x55/0xd0
Oct 24 19:20:58 frontendhd4 kernel: [ 1320.800400]
[<ffffffff810654e7>] sys_exit_group+0x17/0x20

What should I look at next/what's the quickest way to track down this
"lost" urb?

Thanks,
Debabrata
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux