Re: [Bug #14388] keyboard under X with 2.6.31

Linus Torvalds
2009-10-13T23:16:17Z

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