]> Git Repo - linux.git/commitdiff
tty: serial: add missing spin_lock_init for SiFive serial console
authorSagar Shrikant Kadam <[email protected]>
Sat, 9 May 2020 10:24:12 +0000 (03:24 -0700)
committerGreg Kroah-Hartman <[email protected]>
Fri, 15 May 2020 12:55:10 +0000 (14:55 +0200)
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/b9fe49483a903f404e7acc15a6efbef756db28ae[email protected]

Fixes: 45c054d0815b ("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]>
drivers/tty/serial/sifive.c

index 13eadcb8aec4e1554cca30ad399577cf1dace2ae..0b5110dad051085639bc5550f63a6ce52e720d32 100644 (file)
@@ -883,6 +883,7 @@ console_initcall(sifive_console_init);
 
 static void __ssp_add_console_port(struct sifive_serial_port *ssp)
 {
+       spin_lock_init(&ssp->port.lock);
        sifive_serial_console_ports[ssp->port.line] = ssp;
 }
 
This page took 0.061978 seconds and 4 git commands to generate.