Re: [PATCH] printk: handle blank console arguments passed in.

From: Sergey Senozhatsky
Date: Thu Oct 08 2020 - 08:37:54 EST


On (20/10/08 21:20), Sergey Senozhatsky wrote:
[..]
> > > Let me dump my findings so far. I still don't understand what exactly
> > > crashes the laptop (blank screen is not very helpful).
> > >
> > > So, things start with the "preferred_console = -1". In console_setup()
> > > we call __add_preferred_console(). Since we have no consoles, the
> > > name matching loop is not executed, and console selection counter remains
> > > at 0. After the loop, despite the fact that we don't have the console
> > > (`name' is empty), we still set `preferred_console', to 0.
> >
> > Heh, we actually add the console.
>
> To the console drovers list?

Oh, sorry, I realized that you were talking about __add_preferred_console(),
not about console drivers list and console registration.

Well, yeah, that's funny. We sort of add preferred console. But since
it has empty name it's not recognized by printk as legit console. So
essentially it sort of does not exist, yet the preferred selector tells
printk that console does exist.

-ss