Skip to content

Commit

Permalink
serial: core: lock port for start_rx() in uart_resume_port()
Browse files Browse the repository at this point in the history
The only user of the start_rx() callback (qcom_geni) directly calls
its own stop_rx() callback. Since stop_rx() requires that the
port->lock is taken and interrupts are disabled, the start_rx()
callback has the same requirement.

Fixes: cfab87c ("serial: core: Introduce callback for start_rx and do stop_rx in suspend only if this callback implementation is present.")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230525093159.223817-5-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John Ogness authored and Greg Kroah-Hartman committed May 30, 2023
1 parent ca73a89 commit 51e45fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,8 +2430,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
if (console_suspend_enabled)
uart_change_pm(state, UART_PM_STATE_ON);
uport->ops->set_termios(uport, &termios, NULL);
if (!console_suspend_enabled && uport->ops->start_rx)
if (!console_suspend_enabled && uport->ops->start_rx) {
spin_lock_irq(&uport->lock);
uport->ops->start_rx(uport);
spin_unlock_irq(&uport->lock);
}
if (console_suspend_enabled)
console_start(uport->cons);
}
Expand Down

0 comments on commit 51e45fb

Please sign in to comment.