serial: core: lock port for stop_rx() in uart_suspend_port()
[ Upstream commit abcb0cf1f5b2d99b1d117a4dbce334120e358d6d ]
The uarts_ops stop_rx() callback expects that the port->lock is
taken and interrupts are disabled.
Fixes: c9d2325cdb ("serial: core: Do stop_rx in suspend path for console if console_suspend is disabled")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230525093159.223817-3-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c494fe1b66
commit
44470207db
1 changed files with 4 additions and 1 deletions
|
|
@ -2334,8 +2334,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
|
||||||
* able to Re-start_rx later.
|
* able to Re-start_rx later.
|
||||||
*/
|
*/
|
||||||
if (!console_suspend_enabled && uart_console(uport)) {
|
if (!console_suspend_enabled && uart_console(uport)) {
|
||||||
if (uport->ops->start_rx)
|
if (uport->ops->start_rx) {
|
||||||
|
spin_lock_irq(&uport->lock);
|
||||||
uport->ops->stop_rx(uport);
|
uport->ops->stop_rx(uport);
|
||||||
|
spin_unlock_irq(&uport->lock);
|
||||||
|
}
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue