public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: Daniel Thompson <daniel@riscstar.com>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jason Wessel <jason.wessel@windriver.com>,
	Daniel Thompson <danielt@kernel.org>,
	Douglas Anderson <dianders@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Breno Leitao <leitao@debian.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Kees Cook <kees@kernel.org>, Tony Luck <tony.luck@intel.com>,
	"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Andreas Larsson <andreas@gaisler.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jacky Huang <ychuang3@nuvoton.com>,
	Shan-Chun Hung <schung@nuvoton.com>,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>,
	linux-um@lists.infradead.org, linux-kernel@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net,
	linux-serial@vger.kernel.org, netdev@vger.kernel.org,
	linux-m68k@lists.linux-m68k.org, linux-hardening@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 00/19] printk cleanup - part 3
Date: Wed, 14 Jan 2026 09:20:20 +0100	[thread overview]
Message-ID: <aWdRxBbJOEIZ-KjE@pathway.suse.cz> (raw)
In-Reply-To: <89409a0f48e6998ff6dd2245691b9954f0e1e435.camel@suse.com>

On Tue 2026-01-13 21:32:33, Marcos Paulo de Souza wrote:
> On Tue, 2026-01-13 at 09:41 -0300, Marcos Paulo de Souza wrote:
> > On Mon, 2026-01-05 at 14:08 +0000, Daniel Thompson wrote:
> > > On Mon, Jan 05, 2026 at 12:52:14PM +0000, Daniel Thompson wrote:
> > > > Hi Marcos
> > > > 
> > > > On Sat, Dec 27, 2025 at 09:16:07AM -0300, Marcos Paulo de Souza
> > > > wrote:
> > > > > The parts 1 and 2 can be found here [1] and here[2].
> > > > > 
> > > > > The changes proposed in this part 3 are mostly to clarify the
> > > > > usage of
> > > > > the interfaces for NBCON, and use the printk helpers more
> > > > > broadly.
> > > > > Besides it, it also introduces a new way to register consoles
> > > > > and drop thes the CON_ENABLED flag. It seems too much, but in
> > > > > reality
> > > > > the changes are not complex, and as the title says, it's
> > > > > basically a
> > > > > cleanup without changing the functional changes.
> > > > 
> > > > I ran this patchset through the kgdb test suite and I'm afraid it
> > > > is
> > > > reporting functional changes.
> > > > 
> > > > Specifically the earlycon support for kdb has regressed (FWIW the
> > > > problem bisects down to the final patch in the series where
> > > > CON_ENABLED
> > > > is removed).
> > > > 
> > > > Reproduction on x86-64 KVM outside of the test suite should be
> > > > easy:
> > > > 
> > > >     make defconfig
> > > >     scripts/config \
> > > >         --enable DEBUG_INFO \
> > > > 	--enable DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT \
> > > > 	--enable DEBUG_FS \
> > > > 	--enable KALLSYMS_ALL \
> > > > 	--enable MAGIC_SYSRQ \
> > > > 	--enable KGDB \
> > > > 	--enable KGDB_TESTS \
> > > > 	--enable KGDB_KDB \
> > > > 	--enable KDB_KEYBOARD \
> > > > 	--enable LKDTM \
> > > > 	--enable SECURITY_LOCKDOWN_LSM
> > > >     make olddefconfig
> > > >     make -j$(nproc)
> > > >     qemu-system-x86_64 \
> > > >         -m 1G -smp 2 -nographic \
> > > > 	-kernel arch/x86/boot/bzImage \
> > > > 	-append "console=ttyS0,115200 kgdboc=ttyS0
> > > > earlycon=uart8250,io,0x3f8 kgdboc_earlycon kgdbwait"
> > > 
> > > Actually I realized there was a simpler reproduction (hinted at by
> > > the
> > > missing "printk: legacy bootconsole [uart8250] enabled" in the
> > > regressed
> > > case). It looks like the earlycon simply doesn't work and that
> > > means
> > > the
> > > reproduction doesn't require anything related to kgdb at all.
> > > Simply:
> > > 
> > >     make defconfig
> > >     make -j$(nproc)
> > >     qemu-system-x86_64 -m 1G -smp 2 -nographic -kernel
> > > arch/x86/boot/bzImage \
> > >         -append "earlycon=uart8250,io,0x3f8"
> > > 
> > > With the part 3 patchset applied I get no output from the earlycon
> > > (without the patch set I get the early boot messages which, as
> > > expected,
> > > stop when tty0 comes up).
> > 
> > Hi Daniel, sorry for the late reply! Lots of things to check lately
> > :)
> > 
> > Ok, I reproduced here, thanks a lot for testing kgdboc, it's a quick
> > way to check that the new register_console_force is not working. Let
> > me
> > take a look to find what's wrong. Thanks a lot for finding this
> > issue!
> 
> Ok, I did a bisect and found out that the issue lies in the last
> commit, where CON_ENABLED was removed. After it, I then checked what
> was wrong, since everything was being plumbed correctly (tm), and then
> I found that it was not:
> 
> On _register_console, the function try_enable_default_console is called
> when there are not registered consoles, and then it sets CON_ENABLED
> for the console. Later on, try_enable_preferred_console it checks if
> the console was specified by the user, and at the same time it had
> CON_ENABLED set.
> 
> It worked by chance, but now, we don't have this flag anymore, and then
> we are not _marking_ the console on try_enable_default_console so
> try_enable_preferred_console returns ENOENT.

Great catch! Yeah, it worked just by chance.

> So, without any console kgdb is activated much later in the boot
> process, as you found it.
> 
> I talked with Petr Mladek and it would need to rework the way that we
> register a console, and he's already working on it.

Yes, I have some patches in early stages of developnent of another
feature which would help here.

> For now I believe
> that we could take a look in all the patches besides the last one that
> currently breaks the earlycon with kgdb and maybe other usecases.

I agree. I am going to review this patchset first. Then I'll try to
clean up the patches which remove the ugly side effect from
try_enable_preferred_console(). Then we could discuss how
to move forward. It might make sense to push this patchset
first without the last patch...

> Sorry for not catching this issue before. I'll use kgdb next time to
> make sure that it keeps working :)

Do not worry at all. It was a well hidden catch. It is great that
Daniel found the regression in time...

Best Regards,
Petr

  reply	other threads:[~2026-01-14  8:20 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-27 12:16 [PATCH 00/19] printk cleanup - part 3 Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 01/19] printk/nbcon: Use an enum to specify the required callback in console_is_usable() Marcos Paulo de Souza
2026-01-13 16:25   ` Petr Mladek
2026-01-30 15:31     ` John Ogness
2025-12-27 12:16 ` [PATCH 02/19] printk: Introduce console_is_nbcon Marcos Paulo de Souza
2026-01-13 17:37   ` Petr Mladek
2026-01-30 15:50   ` John Ogness
2025-12-27 12:16 ` [PATCH 03/19] printk: Drop flags argument from console_is_usable Marcos Paulo de Souza
2026-01-14  8:44   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 04/19] printk: Reintroduce consoles_suspended global state Marcos Paulo de Souza
2026-01-14 13:12   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 05/19] printk: Add more context to suspend/resume functions Marcos Paulo de Souza
2026-01-14 13:20   ` Petr Mladek
2026-01-30 17:27   ` John Ogness
2025-12-27 12:16 ` [PATCH 06/19] printk: Introduce register_console_force Marcos Paulo de Souza
2026-01-14 14:22   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 07/19] drivers: netconsole: Migrate to register_console_force helper Marcos Paulo de Souza
2026-01-15 10:16   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 08/19] debug: debug_core: " Marcos Paulo de Souza
2026-01-15 10:20   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 09/19] m68k: emu: nfcon.c: " Marcos Paulo de Souza
2026-01-15 10:26   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 10/19] fs: pstore: platform: " Marcos Paulo de Souza
2026-01-15 11:05   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 11/19] powerpc: kernel: udbg: " Marcos Paulo de Souza
2026-01-15 12:13   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 12/19] sparc: kernel: btext: " Marcos Paulo de Souza
2026-01-15 12:14   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 13/19] um: drivers: mconsole_kern.c: " Marcos Paulo de Souza
2026-01-15 12:24   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 14/19] drivers: hwtracing: stm: console.c: " Marcos Paulo de Souza
2026-01-15 12:29   ` Petr Mladek
2026-01-16 13:04   ` Alexander Shishkin
2026-01-16 13:54     ` Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 15/19] drivers: tty: serial: mux.c: " Marcos Paulo de Souza
2026-01-16  9:59   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 16/19] drivers: tty: serial: ma35d1_serial: " Marcos Paulo de Souza
2026-01-15 16:28   ` Petr Mladek
2025-12-27 12:16 ` [PATCH 17/19] drivers: tty: ehv_bytechan: " Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 18/19] drivers: braille: console: Drop CON_ENABLED console flag Marcos Paulo de Souza
2025-12-27 12:16 ` [PATCH 19/19] printk: Remove CON_ENABLED flag Marcos Paulo de Souza
2026-01-05 12:52 ` [PATCH 00/19] printk cleanup - part 3 Daniel Thompson
2026-01-05 14:08   ` Daniel Thompson
2026-01-13 12:41     ` Marcos Paulo de Souza
2026-01-14  0:32       ` Marcos Paulo de Souza
2026-01-14  8:20         ` Petr Mladek [this message]
2026-01-14 16:38         ` Daniel Thompson
2026-01-07 10:22 ` Andreas Larsson
2026-01-12 17:53   ` Marcos Paulo de Souza
2026-02-20 11:43 ` Marcos Paulo de Souza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aWdRxBbJOEIZ-KjE@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andreas@gaisler.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=daniel@riscstar.com \
    --cc=danielt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dianders@chromium.org \
    --cc=edumazet@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gpiccoli@igalia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=jirislaby@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=john.ogness@linutronix.de \
    --cc=kees@kernel.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=kuba@kernel.org \
    --cc=laurentiu.tudor@nxp.com \
    --cc=leitao@debian.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-um@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mpdesouza@suse.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=npiggin@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=richard@nod.at \
    --cc=rostedt@goodmis.org \
    --cc=schung@nuvoton.com \
    --cc=senozhatsky@chromium.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --cc=ychuang3@nuvoton.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox