From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [Bug #14388] keyboard under X with 2.6.31 Date: Tue, 13 Oct 2009 16:16:17 -0700 (PDT) Message-ID: References: <56acieJJ2fF.A.nEB.Hzl0KB@chimera> <87ljjgfcbu.fsf@spindle.srvr.nix> <4AD3F769.5080405@gmail.com> <4AD437F9.9020708@yahoo.co.uk> <4AD4DE4C.4010402@yahoo.co.uk> <20091013223212.3260a7eb@lxorguk.ukuu.org.uk> <20091014001131.302d3272@lxorguk.ukuu.org.uk> Mime-Version: 1.0 Return-path: In-Reply-To: <20091014001131.302d3272-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org> Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Alan Cox Cc: Boyan , =?ISO-8859-15?Q?Fr=E9d=E9ric_L=2E_W=2E_Meunier?= , "Justin P. Mattock" , Nix , Paul Fulghum , "Rafael J. Wysocki" , Linux Kernel Mailing List , Kernel Testers List , Dmitry Torokhov , Ed Tomlinson , OGAWA Hirofumi On Wed, 14 Oct 2009, Alan Cox wrote: > > The better existing lock is probably tty->ldisc_mutex which we take when > doing ldisc changes (which are an even more dramatic change during > receive_buf). Yeah, that makes sense. And then we'd automatically also solve the "somebody tries to write during ldisc changes" issue. Not that I've checked how much it could help, but maybe we could get rid of _some_ of the special "tty_get_ldisc_wait()" kind of hacks. And having that then protect flushing too would get rid of the TTY_FLUSHING and TTY_FLUSHPENDING logic. So it does smell like a good solution (without me looking at the code any closer right now, I can't take any more tty code reading just now ;) Linus