lkml.org 
[lkml]   [2010]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 04/13] tty: make termios mutex nest under tty_lock
Date
On Wednesday 05 May 2010, Arnd Bergmann wrote:
> Most of these are always called without the BTM held.
> Annotate them so we know in the future which places
> to look at. If we can change the code to never
> get termios_mutex while holding the BTM, this
> will solve all lock-order problems between the two.
>
> tty_set_termios_ldisc and tty_reset_termios are currently
> the only functions that always get termios_mutex while
> already holding the BTM.
>
> tty_throttle and tty_unthrottle are called from
> receive_buf which in turn is called from a lot
> of places. It needs more investigation to prove
> that we never hold the BTM while calling these
> two.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Update: I have verified that this one is not needed
at all, because we never take the BTM/BKL while holding
termios_mutex. This is very helpful and will significantly
simplify things towards the end.

With this patch removed, my patch 13 (ldisc_mutex cleanup)
can potentially be applied again, I still need to check
some corner cases with line disciplines calling
tty_driver_flush_buffer and with v253_open calling tty->ops-write
under BTM+ldisc_mutex.

If no tty driver ever takes or releases the BTM/BKL in
their flush_buffer or write functions, things should be
fine.

Arnd


\
 
 \ /
  Last update: 2010-05-05 18:13    [W:0.123 / U:53.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site