]> git.baikalelectronics.ru Git - kernel.git/commit
serial: imx: check the DMA for imx_tx_empty
authorHuang Shijie <b32955@freescale.com>
Fri, 11 Oct 2013 10:30:59 +0000 (18:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Oct 2013 20:19:54 +0000 (13:19 -0700)
commit97ddd91d67d1534eaec74ecc0892c05ff99008ab
tree58472f9fce99b1e056e0e49edfa5e13df86c449c
parent6df2db832546a041d9bc5f30f0e8219aededc013
serial: imx: check the DMA for imx_tx_empty

Assume the following situation:

  If the DMA is enabled, and the a TX DMA operation is working,
But we have not issued the TX DMA operation (or we have issued the
TX DMA operation with dma_async_issue_pending(), but the DMA has not
started to move the data from the memory to the TXFIFO).

At this time, we may get the wrong status of the transmitter when we
call the imx_tx_empty. In such situation, only check the USR2_TXDC
does not enough for us.

This patch checks the DMA's situation, and return 0 when the TX DMA is
working.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c