Linux Serial subsystem development
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Petr Mladek" <pmladek@suse.com>,
	linux-kernel@vger.kernel.org,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Manuel Lauss" <manuel.lauss@gmail.com>,
	"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH tty v6 2/2] serial: 8250: Revert "drop lockdep annotation from serial8250_clear_IER()"
Date: Mon, 20 Jul 2026 15:16:20 +0206	[thread overview]
Message-ID: <878q75u7r7.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20260720103242.7265-3-john.ogness@linutronix.de>

On 2026-07-20, Sashiko wrote:
>> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
>> index 3e623b71dadbc..ca736b1bd0726 100644
>> --- a/drivers/tty/serial/8250/8250_port.c
>> +++ b/drivers/tty/serial/8250/8250_port.c
>> @@ -719,6 +719,9 @@ static void __serial8250_clear_IER(struct uart_8250_port *up)
>>  
>>  static inline void serial8250_clear_IER(struct uart_8250_port *up)
>>  {
>> +	/* Port locked to synchronize UART_IER access against the console */
>> +	lockdep_assert_held_once(&up->port.lock);
>> +
>>  	__serial8250_clear_IER(up);
>>  }
>
> Will restoring this lockdep assertion cause a false-positive warning
> during KGDB polling?
>
> Looking at serial8250_put_poll_char(), it explicitly avoids taking the
> port lock because CPUs are quiesced during KDB/KGDB use:
>
>     /*
>      * Normally the port is locked to synchronize UART_IER access
>      * against the console. However, this function is only used by
>      * KDB/KGDB, where it may not be possible to acquire the port
>      * lock because all other CPUs are quiesced. The quiescence
>      * should allow safe lockless usage here.
>      */
>
> However, it then calls serial8250_clear_IER():
>
>     ier = serial_port_in(port, UART_IER);
>     serial8250_clear_IER(up);
>
> Should serial8250_put_poll_char() be updated to use
> __serial8250_clear_IER() instead to avoid triggering this lockdep
> splat?

Sashiko is correct. For v7 this will be changed to call
__serial8250_clear_IER().

John

      reply	other threads:[~2026-07-20 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20 10:32 [PATCH tty v6 0/2] Convert 8250 to NBCON, take 2 John Ogness
2026-07-20 10:32 ` [PATCH tty v6 1/2] serial: 8250: Switch to nbcon console, " John Ogness
2026-07-20 13:07   ` John Ogness
2026-07-20 14:58   ` Petr Mladek
2026-07-20 16:07     ` John Ogness
2026-07-20 10:32 ` [PATCH tty v6 2/2] serial: 8250: Revert "drop lockdep annotation from serial8250_clear_IER()" John Ogness
2026-07-20 13:10   ` John Ogness [this message]

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=878q75u7r7.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=manuel.lauss@gmail.com \
    --cc=pmladek@suse.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