mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
	"Kees Cook" <kees@kernel.org>,
	"Stepan Ionichev" <sozdayvek@gmail.com>,
	"Osama Abdelkader" <osama.abdelkader@gmail.com>,
	"Fushuai Wang" <wangfushuai@baidu.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH tty v7 1/2] serial: 8250: Switch to nbcon console, take 2
Date: Tue, 21 Jul 2026 16:59:36 +0206	[thread overview]
Message-ID: <871pcw5r7z.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <al57amN8TFhN4IOo@ashevche-desk.local>

On 2026-07-20, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>> +	/* irq_work allowed again. Handle MSR now if pending. */
>> +	up->avoid_modem_status_work = false;
>> +	guard(uart_port_lock_irqsave)(port);
>
> To make guard()() visible, we usually add a blank line before and after
> guard()() line. I dunno if scoped_guard() makes more sense here as Petr
> proposed, I'm fine with either.

Ack.

>> +static void serial8250_console_byte_write(struct uart_8250_port *up,
>> +					  struct nbcon_write_context *wctxt)
>> +{
>> +	struct uart_port *port = &up->port;
>> +	const char *s = wctxt->outbuf;
>> +	const char *end = s + wctxt->len;
>> +
>> +	/*
>> +	 * Write out the message. If a handover or takeover occurs, writing
>> +	 * must be aborted since wctxt->outbuf and wctxt->len are no longer
>> +	 * valid.
>> +	 */
>> +	while (s != end) {
>
> Can len == 0? If not, I would write this as do {} while ().

printk should never make such requests (len=0 means it is a skipped
record) but the driver should not rely on that. Also, this pattern is
the same used by serial8250_console_fifo_write()

>> +/*
>> + * irq_work handler to perform modem control. Only triggered via
>> + * ->write_atomic() callback because it may be in a scheduler or
>> + * NMI context, unable to wake tasks.
>> + */
>> +static void modem_status_handler(struct irq_work *iwp)
>> +{
>> +	struct uart_8250_port *up = container_of(iwp, struct uart_8250_port, modem_status_work);
>> +	struct uart_port *port = &up->port;
>> +
>> +	guard(uart_port_lock)(port);
>
> + blank line.

Ack.

John

  reply	other threads:[~2026-07-21 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 13:54 [PATCH tty v7 0/2] Convert 8250 to NBCON, " John Ogness
2026-07-20 13:54 ` [PATCH tty v7 1/2] serial: 8250: Switch to nbcon console, " John Ogness
2026-07-20 19:47   ` Andy Shevchenko
2026-07-21 14:53     ` John Ogness [this message]
2026-07-20 13:54 ` [PATCH tty v7 2/2] serial: 8250: Revert "drop lockdep annotation from serial8250_clear_IER()" John Ogness
2026-07-20 14:03   ` Sebastian Andrzej Siewior
2026-07-20 19:43     ` Andy Shevchenko

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=871pcw5r7z.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=osama.abdelkader@gmail.com \
    --cc=pmladek@suse.com \
    --cc=sozdayvek@gmail.com \
    --cc=wangfushuai@baidu.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

Powered by JetHome