Skip to content

Commit bcc7ba6

Browse files
liubiingregkh
authored andcommitted
serial: 8250: omap: Move pm_runtime_get_sync
Currently in omap_8250_shutdown, the dma->rx_running flag is set to zero in omap_8250_rx_dma_flush. Next pm_runtime_get_sync is called, which is a runtime resume call stack which can re-set the flag. When the call omap_8250_shutdown returns, the flag is expected to be UN-SET, but this is not the case. This is causing issues the next time UART is re-opened and omap_8250_rx_dma is called. Fix by moving pm_runtime_get_sync before the omap_8250_rx_dma_flush. cc: stable@vger.kernel.org Fixes: 0e31c8d ("tty: serial: 8250_omap: add custom DMA-RX callback") Signed-off-by: Bin Liu <b-liu@ti.com> [Judith: Add commit message] Signed-off-by: Judith Mendez <jm@ti.com> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Tested-by: Kevin Hilman <khilman@baylibre.com> Link: https://lore.kernel.org/r/20241031172315.453750-1-jm@ti.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7dcb7bf commit bcc7ba6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/serial/8250/8250_omap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,12 +776,12 @@ static void omap_8250_shutdown(struct uart_port *port)
776776
struct uart_8250_port *up = up_to_u8250p(port);
777777
struct omap8250_priv *priv = port->private_data;
778778

779+
pm_runtime_get_sync(port->dev);
780+
779781
flush_work(&priv->qos_work);
780782
if (up->dma)
781783
omap_8250_rx_dma_flush(up);
782784

783-
pm_runtime_get_sync(port->dev);
784-
785785
serial_out(up, UART_OMAP_WER, 0);
786786
if (priv->habit & UART_HAS_EFR2)
787787
serial_out(up, UART_OMAP_EFR2, 0x0);

0 commit comments

Comments
 (0)