[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877cbp3nxh.fsf@jogness.linutronix.de>
Date: Thu, 05 Sep 2024 21:29:06 +0206
From: John Ogness <john.ogness@...utronix.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Jiri Slaby
<jirislaby@...nel.org>, Petr Mladek <pmladek@...e.com>, 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, 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-05, Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> On Thu, Sep 05, 2024 at 03:53:18PM +0206, John Ogness wrote:
>> Implement the necessary callbacks to switch the 8250 console driver
>> to perform as an nbcon console.
>>
>> Add implementations for the nbcon console callbacks (write_atomic,
>> write_thread, device_lock, device_unlock) and add CON_NBCON to the
>> initial flags.
>>
>> The legacy code is kept in order to easily switch back to legacy mode
>> by defining USE_SERIAL_8250_LEGACY_CONSOLE.
>
> ...
>
>> static struct console univ8250_console = {
>> .name = "ttyS",
>> +#ifdef USE_SERIAL_8250_LEGACY_CONSOLE
>
> Can it be done at run-time (theoretically or even practically)?
> (Note that we have already knob to disable / enable consoles.)
We don't want to maintain the legacy variant and really people should
not be using it either. NBCON is the way forward for all console
drivers.
I will just remove it for v2. If someone wants to use the old code, they
will need to revert the patch.
>> + if (nbcon_exit_unsafe(wctxt)) {
>> + int len = READ_ONCE(wctxt->len);
>
>> + int i;
>
> unsigned ?
ACK.
>> + /* Atomic console not supported for rs485 mode. */
>
> RS485
ACK.
> Feels like parts (1) and (2) duplicates existing pieces of code. May it be
> refactored to minimize the duplication?
When I remove the unused legacy code, the duplication
disappears. write_thread() and write_atomic() have very little in
common.
John Ogness
Powered by blists - more mailing lists