Re: [RFC][PATCH 0/6] Use printk_safe context for TTY and UART port locks
From: Linus Torvalds
Date: Tue Jun 19 2018 - 22:44:34 EST
On Wed, Jun 20, 2018 at 11:34 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> Perhaps we should do an audit of the console drivers and remove all
> printk, pr_* , WARN*, BUG* from them.
Only the actual _printing_ parts.
Just randomly, look at drivers/tty/vt/vt.c that does a lot of
printing, and there's a lot of valid printing. Things like
pr_warn("Unable to create device for %s; errno = %ld\n", ..
is fine - it's done at console registration time if things go sideways.
But there are a few commented-out calls to "printk()" that are
obviously bogus, because they are in the printing path.
And they damn well should be commented out. The existence of something
like that SHOULD ABSOLUTELY NOT be seen as a "hey, let's make up some
crazy garbage locking ruls that would allow printing there".
Just don't do it. It's that simple.
Linus