]> git.hungrycats.org Git - linux/commit
serial/mxs-auart: increase time to wait for transmitter to become idle
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 28 Jun 2013 09:49:41 +0000 (11:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Aug 2013 22:38:41 +0000 (15:38 -0700)
commit17754964dd55f71fd294ea521c595a1caff3fe5e
tree4dd658d5c36099da0ea72212572e3e6edc0c86c1
parentd11699ef0bb1c2bcb7ba071ee129c2a59457053a
serial/mxs-auart: increase time to wait for transmitter to become idle

commit 079a036f4283e2b0e5c26080b8c5112bc0cc1831 upstream.

Without this patch the driver waits ~1 ms for the UART to become idle. At
115200n8 this time is (theoretically) enough to transfer 11.5 characters
(= 115200 bits/s / (10 Bits/char) * 1ms). As the mxs-auart has a fifo size
of 16 characters the clock is gated too early. The problem is worse for
lower baud rates.

This only happens to really shut down the transmitter in the middle of a
transfer if /dev/ttyAPPx isn't opened in userspace (e.g. by a getty) but
was at least once (because the bootloader doesn't disable the transmitter).

So increase the timeout to 20 ms which should be enough for 9600n8, too.
Moreover skip gating the clock if the timeout is elapsed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mxs-auart.c