lkml.org 
[lkml]   [2018]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] tty: Lock tty pair in tty_init_dev()
From
Date
On Wed, 2018-08-29 at 16:46 +0200, Jiri Slaby wrote:
> On 08/29/2018, 04:23 AM, Dmitry Safonov wrote:
> > It's safe to not lock both here - done to silence attempt lockdep
> > assert in
> > tty_ldisc_open(), which will be added with following patch.
>
> SOrry, could you elaborate here? I don't follow...

Sure, 4/4 patch adds lockdep_assert_held() into tty_ldisc_open().
Currently ldisc in tty->link isn't locked, which according to code
shouldn't be an issue, as far as I can see.

So, this patch silences lockdep warining by holding the semaphore,
which is slowpath anyway and doesn't case any new contention.

(actually, not holding the semaphore for slave might be an issue if one
opens slave before it's fully initialized, but I'm not sure if it's
possible).

--
Thanks,
Dmitry

\
 
 \ /
  Last update: 2018-08-29 18:29    [W:0.115 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site