[PATCH v2 2/4] MIPS: SiByte: Fix bootconsole handover lockup
From: Maciej W. Rozycki
Date: Mon Apr 13 2026 - 00:07:30 EST
Calling sbd_init_port() in the course of setting up the serial device
causes line parameters to be messed up and the transmitter disabled.
We've been lucky in that no message is usually produced to the kernel
log between this call and the later call to uart_set_options() in the
course of console setup done by sbd_serial_console_init(), or the system
would hang as the console output handler in CFE tried to access a port
whose transmitter has been disabled and line parameters messed up.
It'll change with the next change to the driver, so fix sbd_init_port()
such that line parameters are set for 115200n8 console operation as with
the CFE firmware and the transmitter re-enabled after reset.
Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Signed-off-by: Maciej W. Rozycki <macro@xxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # v6.5+
---
No change from v1.
---
drivers/tty/serial/sb1250-duart.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
linux-serial-sb1250-duart-prom-console.diff
Index: linux-macro/drivers/tty/serial/sb1250-duart.c
===================================================================
--- linux-macro.orig/drivers/tty/serial/sb1250-duart.c
+++ linux-macro/drivers/tty/serial/sb1250-duart.c
@@ -542,14 +542,19 @@ static void sbd_init_port(struct sbd_por
/* There is no DUART reset feature, so just set some sane defaults. */
write_sbdchn(sport, R_DUART_CMD, V_DUART_MISC_CMD_RESET_TX);
write_sbdchn(sport, R_DUART_CMD, V_DUART_MISC_CMD_RESET_RX);
- write_sbdchn(sport, R_DUART_MODE_REG_1, V_DUART_BITS_PER_CHAR_8);
+ write_sbdchn(sport, R_DUART_MODE_REG_1,
+ V_DUART_PARITY_MODE_NONE | V_DUART_BITS_PER_CHAR_8);
write_sbdchn(sport, R_DUART_MODE_REG_2, 0);
+ write_sbdchn(sport, R_DUART_CLK_SEL, V_DUART_BAUD_RATE(115200));
write_sbdchn(sport, R_DUART_FULL_CTL,
V_DUART_INT_TIME(0) | V_DUART_SIG_FULL(15));
write_sbdchn(sport, R_DUART_OPCR_X, 0);
write_sbdchn(sport, R_DUART_AUXCTL_X, 0);
write_sbdshr(sport, R_DUART_IMRREG((uport->line) % 2), 0);
+ /* Re-enable transmission for the initial PROM-based console. */
+ write_sbdchn(sport, R_DUART_CMD, M_DUART_TX_EN);
+
sport->initialised = 1;
}