linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>
Cc: "John Ogness" <john.ogness@linutronix.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Sergey Senozhatsky" <senozhatsky@chromium.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Esben Haabendal" <esben@geanix.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Tony Lindgren" <tony@atomide.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Lino Sanfilippo" <l.sanfilippo@kunbus.com>
Subject: Re: [PATCH next v2 3/4] serial: 8250: Switch to nbcon console
Date: Wed, 18 Sep 2024 17:01:27 +0300	[thread overview]
Message-ID: <ZurdNw6lRYwClbuf@smile.fi.intel.com> (raw)
In-Reply-To: <ZurG8YMmBmVVxttj@pathway.suse.cz>

On Wed, Sep 18, 2024 at 02:26:25PM +0200, Petr Mladek wrote:
> On Fri 2024-09-13 16:11:37, 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.
> > 
> > All register access in the callbacks are within unsafe sections.
> > The write_thread() callback allows safe handover/takeover per byte.
> > The write_atomic() callback allows safe handover/takeover per
> > printk record and adds a preceding newline if it took over mid-line.
> > 
> > For the write_atomic() case, a new irq_work is used to defer modem
> > control since it may be a context that does not allow waking up
> > tasks.
> 
> It would be fair to mention that it does not longer support fifo in
> the 8250 driver. It basically reverted the commit 8f3631f0f6eb42e5
> ("serial/8250: Use fifo in 8250 console driver").
> 
> It is not usable in write_thread() because it would not allow
> a safe takeover between emitting particular characters.
> 
> It might still be used in write_atomic() but it is probably not
> worth it. This callback is used "only" in emergency and panic
> situations.

This is unfortunate. It will drop down the efficiency of printing.
I think it should be done differently, i.e. the takeover the code
has to drop FIFO (IIRC it's easy to achieve by disabling it or so)
and switch to printing the panic/emergency message. But still at
some baud rate speeds draining the FIFO to the other end may be
not a bad idea as it takes a few dozens of microseconds.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-09-18 14:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 14:05 [PATCH next v2 0/4] convert 8250 to nbcon John Ogness
2024-09-13 14:05 ` [PATCH next v2 1/4] serial: 8250: Split out IER from rs485_start_tx() John Ogness
2024-09-17 14:48   ` Petr Mladek
2024-09-18 15:04     ` John Ogness
2024-09-19 15:01       ` Petr Mladek
2024-09-13 14:05 ` [PATCH next v2 2/4] serial: 8250: Split out IER from rs485_stop_tx() John Ogness
2024-09-14 10:18   ` kernel test robot
2024-09-18  9:53   ` Petr Mladek
2024-09-13 14:05 ` [PATCH next v2 3/4] serial: 8250: Switch to nbcon console John Ogness
2024-09-18 12:26   ` Petr Mladek
2024-09-18 14:01     ` Andy Shevchenko [this message]
2024-09-18 14:35       ` Petr Mladek
2024-09-18 17:03         ` Andy Shevchenko
2024-09-18 15:19     ` John Ogness
2024-09-18 14:47   ` John Ogness
2024-09-13 14:05 ` [PATCH next v2 4/4] serial: 8250: Revert "drop lockdep annotation from serial8250_clear_IER()" John Ogness
2024-09-18 12:52   ` Petr Mladek

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=ZurdNw6lRYwClbuf@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=esben@geanix.com \
    --cc=fancer.lancer@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=l.sanfilippo@kunbus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tglx@linutronix.de \
    --cc=tony@atomide.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).