Skip to content

Commit

Permalink
serial: 8250: omap: Move pm_runtime_get_sync
Browse files Browse the repository at this point in the history
commit bcc7ba6 upstream.

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: [email protected]
Fixes: 0e31c8d ("tty: serial: 8250_omap: add custom DMA-RX callback")
Signed-off-by: Bin Liu <[email protected]>
[Judith: Add commit message]
Signed-off-by: Judith Mendez <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
liubiin authored and gregkh committed Dec 9, 2024
1 parent 63ff22d commit ad25396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/8250/8250_omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,12 @@ static void omap_8250_shutdown(struct uart_port *port)
struct uart_8250_port *up = up_to_u8250p(port);
struct omap8250_priv *priv = port->private_data;

pm_runtime_get_sync(port->dev);

flush_work(&priv->qos_work);
if (up->dma)
omap_8250_rx_dma_flush(up);

pm_runtime_get_sync(port->dev);

serial_out(up, UART_OMAP_WER, 0);
if (priv->habit & UART_HAS_EFR2)
serial_out(up, UART_OMAP_EFR2, 0x0);
Expand Down

0 comments on commit ad25396

Please sign in to comment.