ftdi_sio occasionally hangs in close()

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

 



Hi,

I seem to be experiencing intermittent problems with calling close()
on an ftdi_sio device.

To try and narrow the problem down I've written a small perl script
which loops round opening and closing /dev/ttyUSB0 with a sleep(1)
between each call.  After somewhere between 20 and 200 cycles the
system hangs trying to close the device.

Once the system hangs, I can switch between virtual terminals and
enter username password for them, but nothing more.  The same is true
of ssh connections.  It prompts for a password then goes silent.  A
hard reboot is then required.

I ran the perl script through strace.  Here is an excerpt of the output:

654   10:29:37.635213 open("/dev/ttyUSB0", O_RDONLY) = 3 <0.007460>
654   10:29:37.642732 ioctl(3, SNDCTL_TMR_TIMEBASE or
SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {c_iflags=0x500,
c_oflags=0x5, c_cflags=0xcbd, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
= 0 <0.000020>
654   10:29:37.642806 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
<0.000009>
654   10:29:37.642850 fstat(3, {st_dev=makedev(0, 5), st_ino=6379,
st_mode=S_IFCHR|0660, st_nlink=1, st_uid=0, st_gid=14,
st_blksize=4096, st_blocks=0, st_rdev=makedev(188, 0),
st_atime=2012/01/27-10:16:59, st_mtime=2012/01/27-10:16:59,
st_ctime=2012/01/27-10:16:59}) = 0 <0.000028>
654   10:29:37.642938 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 <0.000009>
654   10:29:38.643376 close(3)          = 0 <0.005383>
654   10:29:39.649276 open("/dev/ttyUSB0", O_RDONLY) = 3 <0.007475>
654   10:29:39.656797 ioctl(3, SNDCTL_TMR_TIMEBASE or
SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {c_iflags=0x500,
c_oflags=0x5, c_cflags=0xcbd, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
= 0 <0.000016>
654   10:29:39.656864 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
<0.000006>
654   10:29:39.656931 fstat(3, {st_dev=makedev(0, 5), st_ino=6379,
st_mode=S_IFCHR|0660, st_nlink=1, st_uid=0, st_gid=14,
st_blksize=4096, st_blocks=0, st_rdev=makedev(188, 0),
st_atime=2012/01/27-10:16:59, st_mtime=2012/01/27-10:16:59,
st_ctime=2012/01/27-10:16:59}) = 0 <0.000009>
654   10:29:39.656999 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 <0.000025>
654   10:29:40.657481 close(3)          = 0 <0.005275>
654   10:29:41.663575 open("/dev/ttyUSB0", O_RDONLY) = 3 <0.007180>
654   10:29:41.670801 ioctl(3, SNDCTL_TMR_TIMEBASE or
SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {c_iflags=0x500,
c_oflags=0x5, c_cflags=0xcbd, c_lflags=0x8a3b, c_line=0,
c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"})
= 0 <0.000040>
654   10:29:41.670896 lseek(3, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
<0.000049>
654   10:29:41.670991 fstat(3, {st_dev=makedev(0, 5), st_ino=6379,
st_mode=S_IFCHR|0660, st_nlink=1, st_uid=0, st_gid=14,
st_blksize=4096, st_blocks=0, st_rdev=makedev(188, 0),
st_atime=2012/01/27-10:16:59, st_mtime=2012/01/27-10:16:59,
st_ctime=2012/01/27-10:16:59}) = 0 <0.000050>
654   10:29:41.671115 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 <0.000036>
654   10:29:42.671523 close(3

As you can see the last line is incomplete.

I had loaded the ftdi_sio module with the debug option, but I won't be
able to get to the logs from the crash for a few hours.

The logs from booting show:

[    3.916638] USB Serial support registered for FTDI USB Serial Device
[    3.916699] ftdi_sio 4-6:1.0: FTDI USB Serial Device converter detected
[    3.916778] usb 4-6: Detected FT232RL
[    3.916781] usb 4-6: Number of endpoints 2
[    3.916783] usb 4-6: Endpoint 1 MaxPacketSize 64
[    3.916785] usb 4-6: Endpoint 2 MaxPacketSize 64
[    3.916788] usb 4-6: Setting MaxPacketSize 64
[    3.921762] usb 4-6: FTDI USB Serial Device converter now attached to ttyUSB0
[    3.921784] usbcore: registered new interface driver ftdi_sio
[    3.921787] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver

I'm running arch linux 3.2.2-1.

Thanks
--
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