lkml.org 
[lkml]   [2011]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] cdc-acm: Fix potential deadlock (lockdep warning)
On 11/23/2011 10:11 PM, Jiri Slaby wrote:
> On 11/23/2011 10:08 PM, Havard Skinnemoen wrote:
>> tty_port_close_start() takes port->lock, so if we try to do that,
>> we'll turn a potential deadlock into a real one. Or did you mean
>> something else?
>
> I mean the other uses of port->count in your driver.
>
>> I think I'll try to follow Alan's advice and use tty_port_close()
>> instead of the split functions.
>
> Yes, that's indeed the best approach. However you have to use them all:
> tty_port_open, tty_port_hangup, tty_port_close. OR you would have to do
> the locking of count properly.

And I see now that the driver uses tty_port_hangup (count under
port->lock) and tty_port_close_start (count under open_mutex and
port->lock). But doesn't use tty_port_open (count under open_mutex and
acm->mutex). Hence there was always a race hangup vs. open wrt. port
counting.

thanks,
--
js
suse labs


\
 
 \ /
  Last update: 2011-11-23 22:23    [W:0.037 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site