From: Jiri Slaby <jirislaby@kernel.org>
To: Petr Mladek <pmladek@suse.com>
Cc: John Ogness <john.ogness@linutronix.de>,
gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org, Vlastimil Babka <vbabka@suse.cz>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] serial: 8250: drop lockdep annotation from serial8250_clear_IER()
Date: Tue, 15 Aug 2023 12:10:17 +0200 [thread overview]
Message-ID: <781f5f29-c53e-919c-9c31-0a048a625983@kernel.org> (raw)
In-Reply-To: <ZNtE_dcBaDm-wbHt@alley>
On 15. 08. 23, 11:27, Petr Mladek wrote:
> On Mon 2023-08-14 12:21:23, Jiri Slaby wrote:
>> On 14. 08. 23, 12:00, Petr Mladek wrote:
>>> I personally vote to keep it as is unless people see this warning
>>> on daily basis. After all, the lockdep splat is correct. The serial
>>> console might not work correctly in panic() when there is the race.
>>
>> Sorry, but no, the warning is not correct at all. The code path deliberately
>> does NOT take the lock and calls a function which is currently annotated
>> that the lock is _always_ taken. Therefore, the warning is clearly a false
>> positive and I see no reason in keeping it.
>
> There might be a misunderstanding. I only want to keep panic()
> implementation as it is for now. I mean to keep calling
> debug_locks_off() right before console_flush_on_panic().
> The lockdep should stay on before to report potential problems
> in non-printk code, like kexec, panic notifiers.
>
> But I am fine with disabling the particular lockdep_assert_held_once()
> during panic().
>
> It should stay during the normal system state to catch not
> yet discovered races. John is working hard on preventing any
> races which might blow up after introducing the printk kthreads.
>
> I mean something like:
>
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index ecfdc4534123..9533c1eedfb1 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -704,7 +704,8 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
> static 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);
> + if (!oops_in_progress)
> + lockdep_assert_held_once(&up->port.lock);
Yes, this is one of my suggestions ;). (Which I thought are not worth
it, but I am not opposing either.)
thanks,
--
js
suse labs
prev parent reply other threads:[~2023-08-15 10:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 6:43 [PATCH] serial: 8250: drop lockdep annotation from serial8250_clear_IER() Jiri Slaby (SUSE)
2023-08-14 6:15 ` John Ogness
2023-08-14 6:28 ` Jiri Slaby
2023-08-14 8:15 ` John Ogness
2023-08-14 10:00 ` Petr Mladek
2023-08-14 10:21 ` Jiri Slaby
2023-08-15 9:27 ` Petr Mladek
2023-08-15 10:10 ` Jiri Slaby [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=781f5f29-c53e-919c-9c31-0a048a625983@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).