Re: [PATCH v4 0/4] Add support for DEVNAME:0.0 style hardware based addressing

From: Tony Lindgren
Date: Fri Dec 08 2023 - 03:29:12 EST


* Tony Lindgren <tony@xxxxxxxxxxx> [700101 02:00]:
> * Tony Lindgren <tony@xxxxxxxxxxx> [700101 02:00]:
> > We also prepare the serial core to handle the ttyS related quirks done
> > in console_setup() to prepare things for eventually dropping the parsing
> > from console_setup(). This can only happen after further changes to
> > register_console().
>
> Petr FYI, so for dropping the console_setup() parsing, below is a hack
> patch to see what goes wrong in register_console() if you have some ideas
> on how to handle this.
>
> We end up with the console device backed up seria8250 instead of ttyS0,
> and earlycon won't get properly disabled. And of course other consoles
> beyond ttyS need to be also considered.

Hmm so the following extra patch seems to fix the issues based on light
testing. But is it safe to assume that if CON_PRINTBUFFER is set we can
disable the bootconsole?

I also noticed that the bootconsole not getting disabled issue is there
also for console=DEVNAME:0.0 usage even before we start dropping handling
in console_setup().

Regards,

Tony

8< ----------------------
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3549,7 +3549,8 @@ void register_console(struct console *newcon)
*/
con_printk(KERN_INFO, newcon, "enabled\n");
if (bootcon_registered &&
- ((newcon->flags & (CON_CONSDEV | CON_BOOT)) == CON_CONSDEV) &&
+ !(newcon->flags & CON_BOOT) &&
+ (newcon->flags & (CON_CONSDEV | CON_PRINTBUFFER)) &&
!keep_bootcon) {
struct hlist_node *tmp;

--
2.43.0