Commit 23f5f5de authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

serial: qcom-geni: fix shutdown race

A commit adding back the stopping of tx on port shutdown failed to add
back the locking which had also been removed by commit e8376633
("tty: serial: qcom_geni_serial: No need to stop tx/rx on UART
shutdown").

Holding the port lock is needed to serialise against the console code,
which may update the interrupt enable register and access the port
state.

Fixes: d8aca2f9 ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown")
Fixes: 947cc4ec ("serial: qcom-geni: fix soft lockup on sw flow control and suspend")
Cc: stable@vger.kernel.org	# 6.3
Reviewed-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarJohan Hovold <johan+linaro@kernel.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20241009145110.16847-4-johan+linaro@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 19df7666
...@@ -1114,10 +1114,12 @@ static void qcom_geni_serial_shutdown(struct uart_port *uport) ...@@ -1114,10 +1114,12 @@ static void qcom_geni_serial_shutdown(struct uart_port *uport)
{ {
disable_irq(uport->irq); disable_irq(uport->irq);
uart_port_lock_irq(uport);
qcom_geni_serial_stop_tx(uport); qcom_geni_serial_stop_tx(uport);
qcom_geni_serial_stop_rx(uport); qcom_geni_serial_stop_rx(uport);
qcom_geni_serial_cancel_tx_cmd(uport); qcom_geni_serial_cancel_tx_cmd(uport);
uart_port_unlock_irq(uport);
} }
static void qcom_geni_serial_flush_buffer(struct uart_port *uport) static void qcom_geni_serial_flush_buffer(struct uart_port *uport)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment