linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next v2 0/4] convert 8250 to nbcon
@ 2024-09-13 14:05 John Ogness
  2024-09-13 14:05 ` [PATCH next v2 1/4] serial: 8250: Split out IER from rs485_start_tx() John Ogness
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: John Ogness @ 2024-09-13 14:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Petr Mladek, Sergey Senozhatsky, Steven Rostedt,
	Thomas Gleixner, Esben Haabendal, linux-serial, linux-kernel,
	Andy Shevchenko, Sunil V L, Arnd Bergmann, Florian Fainelli,
	Ilpo Järvinen, Lino Sanfilippo, Rengarajan S, Serge Semin,
	Paul E. McKenney, Tony Lindgren, Udit Kumar, Ronald Wahl,
	Uwe Kleine-König, Thomas Richard, Griffin Kroah-Hartman,
	Florian Fainelli, Wolfram Sang, Peter Collingbourne

The recent printk rework introduced a new type of console NBCON
that will perform printing via a dedicated kthread during
normal operation. For times when the kthread is not available
(early boot, panic, reboot/shutdown) the NBCON console will
print directly from the printk() calling context (even if from
NMI).

Futher details about NBCON consoles are in the cover letter of
v1 of the NBCON series [0]. (Note that they were originally
named NOBKL consoles, but were later renamed to NBCON.)

This is v2 of a series to convert the 8250 driver to an NBCON
console, providing both threaded and atomic printing
implementations. v1 of this series is here [1].

Users can verify the UART console is an NBCON console via the
proc filesystem. For example:

$  cat /proc/consoles
ttyS0                -W- (EC N  a)    4:64

The 'N' shows that it is an NBCON console.

There will also be a dedicated printing kthread. For example:

$ ps ax | grep pr/
   16 root       0:00 [pr/ttyS0]

Derek Barbosa performed extensive tests [2] using this driver
and encountered no issues. On the contrary, his tests showed
the improved reliability and non-interference features of the
NBCON-based driver.

Since this is the first console driver to be converted to an
NBCON console, it may include variables and functions that
could be abstracted to all UART consoles (such as the
@console_line_ended field). However, we can abstract such
things later as more consoles are converted to NBCON.

Here are the changes since v1:

- Remove legacy write() code rather than hide it under the
  macro USE_SERIAL_8250_LEGACY_CONSOLE.

- Implement write_atomic() support for RS485 by splitting out
  the IER register modifications into separate wrapper
  functions.

- Update the RS485 call sites to use the new wrapper functions.

- Implement write_atomic() support for modem control by
  deferring to a new dedicated irq_work.

- Rename @console_newline_needed to @console_line_ended and
  invert the logic.

Note that this series is based on the "for-next" branch of the
printk git [3]. This is because the tty-next tree does not have
the NBCON series and thus causes problems for the kbuild
robots. However, this series does apply cleanly on the tty-next
tree (it just will not build).

John Ogness

[0] https://lore.kernel.org/lkml/20230302195618.156940-1-john.ogness@linutronix.de
[1] https://lore.kernel.org/lkml/20240905134719.142554-1-john.ogness@linutronix.de
[2] https://lore.kernel.org/lkml/ZsdoD6PomBRsB-ow@debarbos-thinkpadt14sgen2i.remote.csb
[3] https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git

John Ogness (4):
  serial: 8250: Split out IER from rs485_start_tx()
  serial: 8250: Split out IER from rs485_stop_tx()
  serial: 8250: Switch to nbcon console
  serial: 8250: Revert "drop lockdep annotation from
    serial8250_clear_IER()"

 drivers/tty/serial/8250/8250.h      |   3 +
 drivers/tty/serial/8250/8250_core.c |  35 +++-
 drivers/tty/serial/8250/8250_omap.c |   2 +-
 drivers/tty/serial/8250/8250_port.c | 248 ++++++++++++++++++----------
 include/linux/serial_8250.h         |   9 +-
 5 files changed, 200 insertions(+), 97 deletions(-)


base-commit: b794563ea12fb46d9499da9e30c33d9607e33697
-- 
2.39.2


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-09-19 15:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).