Re: [PATCH v3 1/3] serial: sb1250-duart: Fix console message clobbering at channel resets

From: Florian Fainelli

Date: Tue Nov 03 2026 - 17:15:45 EST


On 8/6/26 03:54, Maciej W. Rozycki wrote:
Ensure any characters outstanding have been sent before issuing channel
resets so as to prevent messages issued to the bootconsole from getting
clobbered.

Contrary to device documentation at the time the transmitter empty bit
is set only the transmit FIFO has been drained and there is still data
outstanding in the transmitter shift register, so wait an extra amount
of time for that register to drain too. This also prevents subsequent
messages produced to the console from getting clobbered, owing to what
seems a transmitter synchronisation issue.

When called from sbd_serial_console_init() it is too early for fsleep()
to work and even before lpj has been calculated, and therefore neither
udelay() works. Therefore delay by hand, observing that roughly 170
iterations over an Input Port Register read are sufficient for the
transmitter to drain with the BCM1250 SoC clocked at 800MHz, so using
2048 iterations should give enough margin including in particular for
the faster BCM1480 SoC clocked at 1GHz.

Fixes: b45d52797432 ("sb1250-duart.c: SB1250 DUART serial support")
Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # v2.6.23+

Tested-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
--
Florian