[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdXY5xv+aqZQmMQ0rDnDWjEF=O0dEaun8x8=J0kb1LZWBQ@mail.gmail.com>
Date: Sun, 6 Jul 2025 12:27:20 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Finn Thain <fthain@...ux-m68k.org>
Cc: Daniel Palmer <daniel@...f.com>, linux-m68k@...ts.linux-m68k.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] m68k/mvme147: Don't unregister boot console needlessly
Hi Finn,
On Tue, 1 Apr 2025 at 02:40, Finn Thain <fthain@...ux-m68k.org> wrote:
> When MACH_IS_MVME147, the boot console calls mvme147_scc_write() to
> generate console output. That will continue to work even after
> debug_cons_nputs() becomes unavailable so there's no need to
> unregister the boot console.
>
> Take the opportunity to remove a repeated MACH_IS_* test. Use the
> actual .write method (instead of a wrapper) and test that pointer
> instead. This means adding an unused parameter to debug_cons_nputs() for
> consistency with the struct console API.
>
> early_printk.c is only built when CONFIG_EARLY_PRINTK=y. As of late,
> head.S is only built when CONFIG_MMU_MOTOROLA=y. So let the former symbol
> depend on the latter, to obviate some ifdef conditionals.
>
> Cc: Daniel Palmer <daniel@...f.com>
> Fixes: 077b33b9e283 ("m68k: mvme147: Reinstate early console")
> Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
Thanks for your patch!
Reviewed-by: Geert Uytterhoeven <geert@...ux-m68k.org>
i.e. will queue in the m68k tree for v6.17...
> --- a/arch/m68k/kernel/early_printk.c
> +++ b/arch/m68k/kernel/early_printk.c
> @@ -55,16 +46,12 @@ early_param("earlyprintk", setup_early_printk);
> * debug_cons_nputs() defined in arch/m68k/kernel/head.S cannot be called
> * after init sections are discarded (for platforms that use it).
> */
... with the above comment moved just before the "if"-test below.
> -#if !(defined(CONFIG_SUN3) || defined(CONFIG_M68000) || \
> - defined(CONFIG_COLDFIRE))
>
> static int __init unregister_early_console(void)
> {
> - if (!early_console || MACH_IS_MVME16x)
> - return 0;
> + if (early_console && early_console->write == debug_cons_nputs)
> + return unregister_console(early_console);
>
> - return unregister_console(early_console);
> + return 0;
> }
> late_initcall(unregister_early_console);
> -
> -#endif
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists