Commit abcb0cf1 authored by John Ogness's avatar John Ogness Committed by Greg Kroah-Hartman
Browse files

serial: core: lock port for stop_rx() in uart_suspend_port()



The uarts_ops stop_rx() callback expects that the port->lock is
taken and interrupts are disabled.

Fixes: c9d2325c ("serial: core: Do stop_rx in suspend path for console if console_suspend is disabled")
Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20230525093159.223817-3-john.ogness@linutronix.de


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1207d86
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2333,8 +2333,11 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
	 * able to Re-start_rx later.
	 */
	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);
			spin_unlock_irq(&uport->lock);
		}
		goto unlock;
	}