From: alexandre.belloni@bootlin.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: early_printk: respect keep parameter
Date: Tue, 17 Jul 2018 22:31:53 +0200 [thread overview]
Message-ID: <20180717203153.GC3211@piout.net> (raw)
In-Reply-To: <nycvar.YSQ.7.76.1807171603240.20892@knanqh.ubzr>
On 17/07/2018 16:16:44-0400, Nicolas Pitre wrote:
> On Wed, 11 Jul 2018, Alexandre Belloni wrote:
>
> > Parse and use the keep parameter of earlyprintk to avoid having the kernel
> > output stop with:
> >
> > Console: colour dummy device 80x30
> > console [tty0] enabled
> > bootconsole [earlycon0] disabled
> >
> > This happens because once tty0, the virtual terminal console is registered,
> > it is selected as the default console, disregarding an existing stdout-path
> > DT property and the early console is shutdown before the console driver is
> > probed.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Why can't you have a real console driver that takes over at that point
> which respects whatever DT property you give it?
>
See Russell's analysis here:
https://www.spinics.net/lists/linux-serial/msg25363.html
> The early_printk code is very raw and inefficient, and it shouldn't be
> used for anything but the debugging of early boot hangs.
>
The issue I had is that he pinctrl driver wasn't probing so the real
console driver could never probe. I think this fits the use case.
Also, atmel_serial doesn't yet have earlycon support.
> > ---
> > arch/arm/kernel/early_printk.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c
> > index 9257736ec9fa..bbb10150b11a 100644
> > --- a/arch/arm/kernel/early_printk.c
> > +++ b/arch/arm/kernel/early_printk.c
> > @@ -42,6 +42,9 @@ static struct console early_console_dev = {
> >
> > static int __init setup_early_printk(char *buf)
> > {
> > + if (buf && strstr(buf, "keep"))
> > + early_console_dev.flags &= ~CON_BOOT;
> > +
> > early_console = &early_console_dev;
> > register_console(&early_console_dev);
> > return 0;
> > --
> > 2.18.0
> >
> >
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Nicolas Pitre <nicolas.pitre@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: early_printk: respect keep parameter
Date: Tue, 17 Jul 2018 22:31:53 +0200 [thread overview]
Message-ID: <20180717203153.GC3211@piout.net> (raw)
In-Reply-To: <nycvar.YSQ.7.76.1807171603240.20892@knanqh.ubzr>
On 17/07/2018 16:16:44-0400, Nicolas Pitre wrote:
> On Wed, 11 Jul 2018, Alexandre Belloni wrote:
>
> > Parse and use the keep parameter of earlyprintk to avoid having the kernel
> > output stop with:
> >
> > Console: colour dummy device 80x30
> > console [tty0] enabled
> > bootconsole [earlycon0] disabled
> >
> > This happens because once tty0, the virtual terminal console is registered,
> > it is selected as the default console, disregarding an existing stdout-path
> > DT property and the early console is shutdown before the console driver is
> > probed.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
> Why can't you have a real console driver that takes over at that point
> which respects whatever DT property you give it?
>
See Russell's analysis here:
https://www.spinics.net/lists/linux-serial/msg25363.html
> The early_printk code is very raw and inefficient, and it shouldn't be
> used for anything but the debugging of early boot hangs.
>
The issue I had is that he pinctrl driver wasn't probing so the real
console driver could never probe. I think this fits the use case.
Also, atmel_serial doesn't yet have earlycon support.
> > ---
> > arch/arm/kernel/early_printk.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/arm/kernel/early_printk.c b/arch/arm/kernel/early_printk.c
> > index 9257736ec9fa..bbb10150b11a 100644
> > --- a/arch/arm/kernel/early_printk.c
> > +++ b/arch/arm/kernel/early_printk.c
> > @@ -42,6 +42,9 @@ static struct console early_console_dev = {
> >
> > static int __init setup_early_printk(char *buf)
> > {
> > + if (buf && strstr(buf, "keep"))
> > + early_console_dev.flags &= ~CON_BOOT;
> > +
> > early_console = &early_console_dev;
> > register_console(&early_console_dev);
> > return 0;
> > --
> > 2.18.0
> >
> >
>
--
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-07-17 20:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 18:32 [PATCH] ARM: early_printk: respect keep parameter Alexandre Belloni
2018-07-11 18:32 ` Alexandre Belloni
2018-07-17 20:16 ` Nicolas Pitre
2018-07-17 20:16 ` Nicolas Pitre
2018-07-17 20:31 ` Alexandre Belloni [this message]
2018-07-17 20:31 ` Alexandre Belloni
2018-07-17 20:48 ` Nicolas Pitre
2018-07-17 20:48 ` Nicolas Pitre
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=20180717203153.GC3211@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.