[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFQmdRYh3vSz4s-ks5dbz7bXJx-EZNHEGzsr5bcpEYquXmB6Fg@mail.gmail.com>
Date: Wed, 23 Nov 2011 11:22:32 -0800
From: Havard Skinnemoen <hskinnemoen@...gle.com>
To: Alan Cox <alan@...ux.intel.com>
Cc: Jiri Slaby <jslaby@...e.cz>, Dave Jones <davej@...hat.com>,
Linux Kernel <linux-kernel@...r.kernel.org>,
Greg Kroah-Hartman <gregkh@...e.de>,
Jiri Slaby <jirislaby@...il.com>
Subject: Re: [RFC] cdc-acm: Fix potential deadlock (lockdep warning)
On Wed, Nov 23, 2011 at 11:22 AM, Alan Cox <alan@...ux.intel.com> wrote:
> take lock
> mark device disconnected
> drop lock
> for each tty on the device {
> tty_port_tty_get
> if (tty) {
> tty_vhangup(tty);
> tty_kref_put(tty);
> }
> then do the USB disconnect processing
> and drop our USB side kref
Ok, by USB side kref do you mean the tty_port_get/put calls I
introduced in this patch, or a kref associated with the USB device
itself?
> and on the open side they provide their own install() method which
> nicely avoids all the nasty locking problems and lets them use the
> standard tty_port_open/close/hangup etc rather than the partial ones.
Right, that makes sense.
> It might be worth turning the ACM driver to work the same way as it'll
> save doing that work later to achieve the same use of
> tty_port_open/close/..
>
> The main thing is the use of install - which lets you plug the USB and
> tty bits together during the lookup of the device.
Ok, so the basic idea is:
* USB side: tty_port_get() in probe, tty_port_put() in disconnect
* TTY side: tty_port_get() in install, tty_port_put() in remove
And I need to check if the device is properly marked as disconnected,
switch to vhangup, and possibly reorder things a bit as well. Right?
Havard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists