Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934415AbZJMWzs (ORCPT ); Tue, 13 Oct 2009 18:55:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760575AbZJMWzr (ORCPT ); Tue, 13 Oct 2009 18:55:47 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:53116 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751458AbZJMWzq (ORCPT ); Tue, 13 Oct 2009 18:55:46 -0400 Date: Tue, 13 Oct 2009 15:54:45 -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: <20091013223212.3260a7eb@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> 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: 1173 Lines: 29 On Tue, 13 Oct 2009, Alan Cox wrote: > > I can't help feeling a mutex might be simpler. It would also then fix > tiocsti() which is most definitely broken right now and documented as > racing. Hmm. Those tty's have too many different locks already. But maybe we could just have one generic mutex, and use it for termios and IO locking. It makes perfect sense to serialize the ->receive_buf() code with any termios changes, since termios is what affects _how_ that ->receive_buf() function works. I do wonder why tiocsti() doesn't just use the tty buffering layer, though? Maybe that harks back to the whole "pty's did things differently" thing? Why does it go directly to ->receive_buf() in the first place? And let's see if my patch even makes a difference. Maybe the breakage is somewhere else. The "oh, now we call flush_ldisc() from two different contexts" thing seems to be a promising lead, but ... 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/