Skip to content

Commit

Permalink
serial: imx: only set dma_is_rxing when DMA starts
Browse files Browse the repository at this point in the history
The variable dma_is_rxing is currently set to 1 in imx_disable_rx_int().
This is problematic as:

- whilst imx_disable_rx_int() is currently always called before
  start_rx_dma() this dependency isn't obvious.
- start_rx_dma() does error checking and might exit without
  enabling DMA. Currently this will result in dma_is_rxing suggesting
  that DMA is being used for recieving.

To avoid these issues, move the setting of dma_is_rxing to
start_rx_dma() when appropriate.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Romain Perier authored and Greg Kroah-Hartman committed Oct 3, 2017
1 parent 177b508 commit 4139fd7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,6 @@ static void imx_disable_rx_int(struct imx_port *sport)
{
unsigned long temp;

sport->dma_is_rxing = 1;

/* disable the receiver ready and aging timer interrupts */
temp = readl(sport->port.membase + UCR1);
temp &= ~(UCR1_RRDYEN);
Expand Down Expand Up @@ -1076,6 +1074,7 @@ static int start_rx_dma(struct imx_port *sport)
desc->callback_param = sport;

dev_dbg(dev, "RX: prepare for the DMA.\n");
sport->dma_is_rxing = 1;
sport->rx_cookie = dmaengine_submit(desc);
dma_async_issue_pending(chan);
return 0;
Expand Down

0 comments on commit 4139fd7

Please sign in to comment.