ftdi_sio doesnt work propertly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Jaunty |
Fix Released
|
Medium
|
Stefan Bader |
Bug Description
SRU Justification:
Impact: 2.6.28 kernels (only) have a reference counting bug in ftdi_sio that frequently renders /dev/ttyUSBn devices useless when they're closed, fixed only by a reboot.
Fix: The bug was fixed in 2.6.29 by a9fec7102f, by exiting with correctly releasing the reference.
Testcase: See below.
---
i have irda device "irlink" on FTDI chipset when i connect it, device /dev/ttyUSB0 apears but when i try to sent a signal to my irlink nothing coming to port /dev/ttyUSB0 (cat /dev/ttyUSB0) device works good under Windows and as i heard it worked on Ubuntu earlear versions(6.04 if i remember right)
#lsusb -v
Bus 006 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
bcdDevice 6.00
iManufacturer 1 FTDI
iProduct 2 FT232R USB UART
iSerial 3 A90058ya
bNumConfigura
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurat
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 90mA
Interface Descriptor:
bLength 9
bDescript
bInterfac
bAlternat
bNumEndpoints 2
bInterfac
bInterfac
bInterfac
iInterface 2 FT232R USB UART
Endpoint Descriptor:
bLength 7
Transfer Type Bulk
Synch Type None
Usage Type Data
bInterval 0
Endpoint Descriptor:
bLength 7
Transfer Type Bulk
Synch Type None
Usage Type Data
bInterval 0
Device Status: 0x0000
(Bus Powered)
#dmesg
[ 4305.936047] usb 6-1: new full speed USB device using uhci_hcd and address 3
[ 4306.123976] usb 6-1: configuration #1 chosen from 1 choice
[ 4306.177503] usbcore: registered new interface driver usbserial
[ 4306.177519] USB Serial support registered for generic
[ 4306.177574] usbcore: registered new interface driver usbserial_generic
[ 4306.177576] usbserial: USB Serial Driver core
[ 4306.182914] USB Serial support registered for FTDI USB Serial Device
[ 4306.183030] ftdi_sio 6-1:1.0: FTDI USB Serial Device converter detected
[ 4306.183054] usb 6-1: Detected FT232RL
[ 4306.183103] usb 6-1: FTDI USB Serial Device converter now attached to ttyUSB0
[ 4306.183118] usbcore: registered new interface driver ftdi_sio
[ 4306.183120] ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
HibernationDevice: RESUME=
MachineType:
NonfreeKernelMo
Package: linux-image-
ProcCmdLine: root=UUID=
ProcEnviron:
PATH=(custom, no user)
LANG=ru_RU.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: linux
description: | updated |
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Fix Released |
Changed in linux (Ubuntu Jaunty): | |
assignee: | nobody → Stefan Bader (stefan-bader-canonical) |
importance: | Undecided → Medium |
status: | New → In Progress |
description: | updated |
Changed in linux (Ubuntu Jaunty): | |
status: | In Progress → Fix Committed |
tags: |
added: verification-done removed: verification-needed |
We are using ftdi_sio with a 232M chip.
On intrepid and with jaunty's 2.6.27 kernel, ftdi_sio works like a charm on different setups (x86 IA32 and x86_64).
On 2.6.28-10 and -13, we have the following regression (x86 IA32): one program opens the device, sends/receives data, then closes it. This works at least once. This can be done several times, but at some point it will fail: after a close() (or directly a program exit), no other program can open the device again (Input/output error in open). If I rmmod the module (rmmod or modprobe -r), unplug/plug the device back again, etc. (I tried many combinations) I cannot ever open the device again: I have to reboot the machine. And modprobe with debug=1 doesn't suggest anything (no message beyond USB device connect/ enumeration) . I didn't spy on the bus with usbmon since I could have a working setup with 2.6.27.
I noticed that the bug seems to be more (always ?) reproducible with pyserial then with direct libc open/close from C: after one has used a pyserial script with the device, nobody can ever use the device again. Reboot needed...