tty: usb-serial krefs - ti_usb returns EIO when reopening the device
Subsystems (2)
Hello,
commit 4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c
tty: usb-serial krefs
Use kref in the USB serial drivers so that we don't free tty structures from under the URB receive handlers as has historically been the case if you were unlucky. This also gives us a framework for general tty drivers to use tty_port objects and refcount.
Contains two err->dev_err changes merged together to fix clashes in the -next tree.
----
introduced a problem to the TI USB to serial converter code, which is needed for the debug interface device MSP-FET430UIF from Texas Instruments. The driver works as expected until you close the device and try to reopen it. All you get from now on, is an I/O error. It seems that something isn't released correctly, because the refcount of the usbserial module does not drop to zero, even when unloading all dependend drivers.
A "it works for me now" patch is attached. I've tested it with a vanilla 2.6.29.
Christoph
(quoted diff) +0 -0
b/drivers/usb/serial/ti_usb_3410_5052.c
index 2620bf6..f11d8ac 100644
drivers/usb/serial/ti_usb_3410_5052.c +1 -1
@@ -1229,8 +1229,8 @@ static void ti_bulk_in_callback(struct urb *urb)spin_lock (&tport->tp_lock); tport->tp_icount.rx += urb->actual_length;spin_unlock (&tport->tp_lock); -tty_kref_put (tty); } +tty_kref_put (tty); exit:/* continue to read unless stopping */