Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761434AbZJMXRg (ORCPT ); Tue, 13 Oct 2009 19:17:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760951AbZJMXRg (ORCPT ); Tue, 13 Oct 2009 19:17:36 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:40545 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759324AbZJMXRf (ORCPT ); Tue, 13 Oct 2009 19:17:35 -0400 Date: Tue, 13 Oct 2009 16:16:17 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain 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 Subject: Re: [Bug #14388] keyboard under X with 2.6.31 In-Reply-To: <20091014001131.302d3272@lxorguk.ukuu.org.uk> 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> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 24 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/