[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jzfod9f2.fsf@jogness.linutronix.de>
Date: Fri, 06 Sep 2024 18:44:41 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Petr Mladek <pmladek@...e.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby
<jirislaby@...nel.org>, Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>, Thomas Gleixner
<tglx@...utronix.de>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, Andy Shevchenko
<andriy.shevchenko@...ux.intel.com>, Tony Lindgren <tony@...mide.com>,
"Paul E. McKenney" <paulmck@...nel.org>, Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, Ilpo Järvinen
<ilpo.jarvinen@...ux.intel.com>, Serge Semin <fancer.lancer@...il.com>,
Rengarajan S <rengarajan.s@...rochip.com>, Wolfram Sang
<wsa+renesas@...g-engineering.com>
Subject: Re: [PATCH next v1 1/2] serial: 8250: Switch to nbcon console
On 2024-09-06, John Ogness <john.ogness@...utronix.de> wrote:
>> Wait! This makes the rs485 consoles much less usable for debugging.
>> They might have troubles to see the emergency and panic messages.
>>
>> Is this acceptable? Why?
>
> It is not acceptable. I am looking into making the atomic part work for
> RS485 as well.
So there are 2 things _not_ supported by the write_atomic() callback:
1. RS485 mode. This is due to the need to start up TX for the
write, which can lead to:
up->rs485_start_tx()
serial8250_em485_start_tx()
serial8250_stop_rx()
serial8250_rpm_get()
pm_runtime_get_sync()
__pm_runtime_resume()
spin_lock_irqsave()
Taking a spin lock is not safe from NMI and thus disqualifies this call
chain for write_atomic().
If UART_CAP_RPM is not set, the pm_runtime_get_sync() is avoided. So I
could only disable atomic RS485 if UART_CAP_RPM is set. But the OMAP
variant of the 8250 does set this capability.
2. Modem control. This is due to waiting for inputs, which can lead to:
serial8250_modem_status()
wake_up_interruptible()
Performing wakes is not safe from scheduler or NMI and thus disqualifies
this call chain for write_atomic().
It would probably be acceptable to move serial8250_modem_status() into
an irq_work.
I would be grateful for any insights on how best to handle these 2
issues if we want full write_atomic() support for all 8250 variants.
John
Powered by blists - more mailing lists