[PATCH 0/2] braille: nbcon: Allow using a serial driver converted to nbcon API as a Braille console

Petr Mladek posted 2 patches 2 days, 8 hours ago
.../accessibility/braille/braille_console.c   | 38 +++++++++++-
drivers/tty/serial/8250/8250_port.c           |  5 +-
include/linux/console.h                       |  8 +++
kernel/printk/nbcon.c                         | 59 +++++++++++++++++++
4 files changed, 107 insertions(+), 3 deletions(-)
[PATCH 0/2] braille: nbcon: Allow using a serial driver converted to nbcon API as a Braille console
Posted by Petr Mladek 2 days, 8 hours ago
Hi,

I have been working on v5 [1] of the patchset cleaning console registration
code and I found that the system did not boot when I selected a Braille
on the command line, for example:

     console=brl,ttyS0,115200 console=tty0

Bisection went down to the commit d3539347022a ("serial: 8250: Switch to
nbcon console, take 2"). I found that the Braille console driver called
braille_co->write() internally where braille_co pointed to the uart
8250 driver.

I added the support for the nbcon console API similar way as we did
for kdb [2].

Note 1: I believe that we have a bug in the kdb patch because we call
        con->write() atomic callback after entering the unsafe mode.
        But we should do so in the default "safe" mode.

Note 2: I am not completely sure about the locking. It might be better
        to use NBCON_PRIO_PANIC in panic().

        Also I thought about using con->write_thread(). But I think
	that we have to use the atomic variant because the Braille
	console can be called from printk() via the VT code, aka
	graphical console.

Note 3: I do not have any device to read the Braille output so I am not
	sure if the output is correct. I just checked the output on
	the serial console and it is a bit suspicious. It looks like
	it prints every message N-times when N is the length of the string.
	And it adds one character in each iteration, for example:

<paste>
E>[                                       E>[                                       E>[  O                                    *>[  OK                                   A>[  OK                                   A>[  OK                                   A>[  OK  ]                                <>[  OK  ]                                <>[  OK  ] R                              N>[  OK  ] Re                             
       >[  OK  ] Rea                            J>[  OK  ] Reac                           	>[  OK  ] Reach                          A>[  OK  ] Reache                         D>[  OK  ] Reached                        @>[  OK  ] Reached                        @>[  OK  ] Reached t           
</paste>

	But I think that this is not caused by the NBCON console API.

[1] https://lore.kernel.org/all/20260604101459.393162-1-pmladek@suse.com/
[2] https://lore.kernel.org/all/20251016-nbcon-kgdboc-v6-0-866aac60a80e@suse.com/

Petr Mladek (2):
  printk: nbcon: Introduce Braille helpers
  braille: nbcon: Use nbcon atomic console callbacks

 .../accessibility/braille/braille_console.c   | 38 +++++++++++-
 drivers/tty/serial/8250/8250_port.c           |  5 +-
 include/linux/console.h                       |  8 +++
 kernel/printk/nbcon.c                         | 59 +++++++++++++++++++
 4 files changed, 107 insertions(+), 3 deletions(-)

-- 
2.55.0