Re: printk() vs tty_io

From: Linus Torvalds
Date: Wed Dec 14 2011 - 10:55:19 EST


On Wed, Dec 14, 2011 at 6:23 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>>
>> printk() goes through serial8250_console_write() which writes to the
>> UART device using a busy loop, with local IRQ's disabled.  So it's not
>> serial8250_console_write() which is waking things up; this is coming
>> form interrupt handler running on some different CPU.
>
> Which can still deadlock you just fine..

Ugh. There is a *ton* of stuff inside that serial port lock,
including, yes, the uart_write_wakeup().

And it does look like it's protecting port->tty or something, so I
don't see that we can just move the wakeup to outside the lock, which
was my first reaction.

Ugh.

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/