From: 'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>
To: "Toshiyuki Sato (Fujitsu)" <fj6611ie@fujitsu.com>
Cc: Russell King <linux@armlinux.org.uk>,
Jiri Slaby <jirislaby@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] serial: amba-pl011: Implement nbcon console
Date: Fri, 10 Jan 2025 15:54:19 +0100 [thread overview]
Message-ID: <2025011031-lying-spirits-e326@gregkh> (raw)
In-Reply-To: <TY4PR01MB137779148D6C8C537E7108071D7132@TY4PR01MB13777.jpnprd01.prod.outlook.com>
On Thu, Jan 09, 2025 at 01:04:36AM +0000, Toshiyuki Sato (Fujitsu) wrote:
> Hi, Greg. Thanks for the comment.
>
> > On Wed, Jan 08, 2025 at 12:47:30AM +0000, Toshiyuki Sato wrote:
> > > Implement the callbacks required for an NBCON console [0] on the
> > > amba-pl011 console driver.
> > > The codes for legacy console are retained, and the module
> > > parameter (use_nbcon) allows switching between legacy and NBCON.
> > > The default is off (use legacy console) for now.
> > >
> > > Referred to the NBCON implementation work for 8250 [1] and imx [2].
> > >
> > > The normal-priority write_thread checks for console ownership
> > > each time a character is printed.
> > > write_atomic holds the console ownership until the entire string
> > > is printed.
> > >
> > > UART register operations are protected from other contexts by
> > > uart_port_lock, except for a final flush(nbcon_atomic_flush_unsafe)
> > > on panic.
> > >
> > > The patch has been verified to correctly handle the output and
> > > competition of messages with different priorities and flushing
> > > panic message to console after nmi panic using ARM64 QEMU and
> > > a physical machine(A64FX).
> > >
> > > [0] https://lore.kernel.org/all/ZuRRTbapH0DCj334@pathway.suse.cz/
> > > [1]
> > https://lore.kernel.org/all/20240913140538.221708-1-john.ogness@linutronix.d
> > e/T/
> > > [2]
> > https://lore.kernel.org/linux-arm-kernel/20240913-serial-imx-nbcon-v3-1-4c62
> > 7302335b@geanix.com/T/
> > >
> > > Signed-off-by: Toshiyuki Sato <fj6611ie@aa.jp.fujitsu.com>
> > > ---
> > > drivers/tty/serial/amba-pl011.c | 113
> > ++++++++++++++++++++++++++++++++
> > > 1 file changed, 113 insertions(+)
> > >
> > > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> > > index 69b7a3e1e..52fab3170 100644
> > > --- a/drivers/tty/serial/amba-pl011.c
> > > +++ b/drivers/tty/serial/amba-pl011.c
> > > @@ -41,6 +41,7 @@
> > > #include <linux/sizes.h>
> > > #include <linux/io.h>
> > > #include <linux/acpi.h>
> > > +#include <linux/moduleparam.h>
> > >
> > > #define UART_NR 14
> > >
> > > @@ -263,6 +264,7 @@ struct uart_amba_port {
> > > char type[12];
> > > bool rs485_tx_started;
> > > unsigned int rs485_tx_drain_interval; /* usecs */
> > > + bool console_line_ended;
> > > #ifdef CONFIG_DMA_ENGINE
> > > /* DMA stuff */
> > > unsigned int dmacr; /* dma control reg */
> > > @@ -274,6 +276,10 @@ struct uart_amba_port {
> > > #endif
> > > };
> > >
> > > +/* if non-zero, the console is nbcon. */
> > > +static int use_nbcon;
> > > +module_param(use_nbcon, int, 0444);
> >
> > Why is a module parameter needed here? That feels wrong and not
> > scalable at all. What happens if you have multiple devices, which one
> > is nbcon and which isn't?
>
> This module parameter is for pl011 driver.
Yes, and module parameters are from the 1990's, let's not add new ones
please.
> With this patch implemented, only one type will be usable, depending
> on the value of use_nbcon.
> I thought it would be more user-friendly if legacy operation could be
> selected via boot parameter.
> Would it be better to make the patch purely nbcon-compatible, without
> retaining the legacy functionality?
Why would you want the "legacy" functionality? Aren't we converting all
consoles over to use the new stuff?
thanks,
greg k-h
next prev parent reply other threads:[~2025-01-10 15:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 0:47 [PATCH] serial: amba-pl011: Implement nbcon console Toshiyuki Sato
2025-01-08 8:13 ` Greg Kroah-Hartman
2025-01-09 1:04 ` Toshiyuki Sato (Fujitsu)
2025-01-10 14:54 ` 'Greg Kroah-Hartman' [this message]
2025-01-15 4:23 ` Toshiyuki Sato (Fujitsu)
2025-01-09 15:57 ` kernel test robot
2025-01-09 16:10 ` kernel test robot
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=2025011031-lying-spirits-e326@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=fj6611ie@fujitsu.com \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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.