mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Mair <christoph.mair@gmail.com>
To: alan@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org
Subject: tty: usb-serial krefs - ti_usb returns EIO when reopening the device
Date: Tue, 14 Apr 2009 03:14:39 +0200	[thread overview]
Message-ID: <200904140314.46647.christoph.mair@gmail.com> (raw)

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.

Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

----

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


diff --git a/drivers/usb/serial/ti_usb_3410_5052.c 
b/drivers/usb/serial/ti_usb_3410_5052.c
index 2620bf6..f11d8ac 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -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 */

                 reply	other threads:[~2009-04-14  1:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200904140314.46647.christoph.mair@gmail.com \
    --to=christoph.mair@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®