Skip to content

Commit 17b4efd

Browse files
sagsifivegregkh
authored andcommitted
tty: serial: add missing spin_lock_init for SiFive serial console
An uninitialised spin lock for sifive serial console raises a bad magic spin_lock error as reported and discussed here [1]. Initialising the spin lock resolves the issue. The fix is tested on HiFive Unleashed A00 board with Linux 5.7-rc4 and OpenSBI v0.7 [1] https://lore.kernel.org/linux-riscv/[email protected] Fixes: 45c054d ("tty: serial: add driver for the SiFive UART") Reported-by: Atish Patra <[email protected]> Signed-off-by: Sagar Shrikant Kadam <[email protected]> Reviewed-by: Palmer Dabbelt <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2ef96a5 commit 17b4efd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/tty/serial/sifive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,7 @@ console_initcall(sifive_console_init);
883883

884884
static void __ssp_add_console_port(struct sifive_serial_port *ssp)
885885
{
886+
spin_lock_init(&ssp->port.lock);
886887
sifive_serial_console_ports[ssp->port.line] = ssp;
887888
}
888889

0 commit comments

Comments
 (0)