]> git.baikalelectronics.ru Git - kernel.git/commit
msm_serial: Fix NUL byte output on UARTDM
authorStephen Boyd <sboyd@codeaurora.org>
Wed, 24 Jul 2013 18:37:28 +0000 (11:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2013 23:13:29 +0000 (16:13 -0700)
commitf2bcf83f397fd65dc267075ec7dd0dc7851e4dfb
treebd8c8bb7a169052f3fed6af81790e8efedd48c19
parent9943bee2e6a65475787209aa02f027494ecf10a0
msm_serial: Fix NUL byte output on UARTDM

UARTDM serial devices require us to wait for the entire TX fifo
to drain before we can change the contents of the NCF_TX
register. Furthermore, if we write any characters to the TX fifo
within the same clock cycle of changing the NCF_TX register the
NCF_TX register won't latch properly.

To fix these issues we should read back the NCF_TX register to
delay any TX fifo accesses by a clock cycle and we should wait
for the TX fifo to drain (instead of just waiting for the fifo to
be ready to receive more characters). Failure to do so leads to
random NUL bytes interspersed in the output.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/msm_serial.c
drivers/tty/serial/msm_serial.h