Skip to content

Commit

Permalink
serial: imx: call imx_dma_tx() again in dma_tx_callback
Browse files Browse the repository at this point in the history
Currently in dma_tx_callback(), no matter if there is still
remaining data pending in circle buffer or not, DMA transmit
will be terminated.

This will result in some data never get transmitted.
In order to fix this issue, call imx_dma_tx() again in
dma_tx_callback, when there is pending data and uart hasn't
been stopped.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jiada Wang authored and Greg Kroah-Hartman committed Jan 9, 2015
1 parent d64b860 commit 0bbc9b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
imx_stop_tx(&sport->port);
}

static void imx_dma_tx(struct imx_port *sport);
static void dma_tx_callback(void *data)
{
struct imx_port *sport = data;
Expand Down Expand Up @@ -524,6 +525,11 @@ static void dma_tx_callback(void *data)
dev_dbg(sport->port.dev, "exit in %s.\n", __func__);
return;
}

spin_lock_irqsave(&sport->port.lock, flags);
if (!uart_circ_empty(xmit) && !uart_tx_stopped(&sport->port))
imx_dma_tx(sport);
spin_unlock_irqrestore(&sport->port.lock, flags);
}

static void imx_dma_tx(struct imx_port *sport)
Expand Down

0 comments on commit 0bbc9b8

Please sign in to comment.