]> git.karo-electronics.de Git - karo-tx-linux.git/commit
serial: imx: implement the flush_buffer hook
authorHuang Shijie <b32955@freescale.com>
Wed, 9 Oct 2013 07:13:23 +0000 (15:13 +0800)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:55:58 +0000 (09:55 +0800)
commitf772042955e2e8fe1bc47312783ab13526a168b9
tree71236d80e0d7774f3748faf7005e49d7d4bf912b
parenta25e49ff3dc65a43b1ff67d31bec1042d2e8e230
serial: imx: implement the flush_buffer hook

The current driver does not implement the flush_buffer hook for
uart_ops. When we enable the DMA for the driver, and test it with Bluetooth,
we may meet the following bug for TX:

    [1] User application may call the flush operation at any time.
        The uart_flush_buffer() calls the uart_circ_clear() to set
        the xmit->head and xmit->tail with 0.

    [2] The TX DMA callback can be called at any time too.
        The dma_tx_call() will update the xmit->tail.

    If [2] occurs just after the [1], we will get the wrong xmit->tail.

This patch implements the flush_buffer hook to fix this issue.

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