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

From: Linus Torvalds
Date: Tue Oct 13 2009 - 18:57:00 EST




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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/