Skip to content

Commit 6a54113

Browse files
jhovoldgregkh
authored andcommitted
serial: qcom-geni: fix shutdown race
commit 23f5f5d upstream. A commit adding back the stopping of tx on port shutdown failed to add back the locking which had also been removed by commit e837663 ("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: d8aca2f ("tty: serial: qcom-geni-serial: stop operations in progress at shutdown") Fixes: 947cc4e ("serial: qcom-geni: fix soft lockup on sw flow control and suspend") Cc: stable@vger.kernel.org # 6.3 Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20241009145110.16847-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fa17ed8 commit 6a54113

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,10 +1096,12 @@ static void qcom_geni_serial_shutdown(struct uart_port *uport)
10961096
{
10971097
disable_irq(uport->irq);
10981098

1099+
uart_port_lock_irq(uport);
10991100
qcom_geni_serial_stop_tx(uport);
11001101
qcom_geni_serial_stop_rx(uport);
11011102

11021103
qcom_geni_serial_cancel_tx_cmd(uport);
1104+
uart_port_unlock_irq(uport);
11031105
}
11041106

11051107
static void qcom_geni_serial_flush_buffer(struct uart_port *uport)

0 commit comments

Comments
 (0)