Skip to content

Commit 0f87aa6

Browse files
andy-shevgregkh
authored andcommitted
serial: sunhv: Initialize lock for non-registered console
The commit a3cb39d ("serial: core: Allow detach and attach serial device for console") changed a bit logic behind lock initialization since for most of the console driver it's supposed to have lock already initialized even if console is not enabled. However, it's not the case for Sparc HV console. Initialize lock explicitly in the ->probe(). Note, there is still an open question should or shouldn't not this driver register console properly. Fixes: a3cb39d ("serial: core: Allow detach and attach serial device for console") Reported-by: Anatoly Pugachev <[email protected]> Cc: David Miller <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Anatoly Pugachev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 18cc7ac commit 0f87aa6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/tty/serial/sunhv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,9 @@ static int hv_probe(struct platform_device *op)
567567
sunserial_console_match(&sunhv_console, op->dev.of_node,
568568
&sunhv_reg, port->line, false);
569569

570+
/* We need to initialize lock even for non-registered console */
571+
spin_lock_init(&port->lock);
572+
570573
err = uart_add_one_port(&sunhv_reg, port);
571574
if (err)
572575
goto out_unregister_driver;

0 commit comments

Comments
 (0)