]> git.baikalelectronics.ru Git - kernel.git/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>
Fri, 26 Jul 2013 23:34:00 +0000 (16:34 -0700)
commit057f26d8307625a4625b358cf2f3645da2eb5300
tree0e4e39b000d63c5a49d37b06f101d0f237fee73f
parenteb9713ea2b9f3951831220544c223775f1d64072
serial/mxs-auart: increase time to wait for transmitter to become idle

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.

Cc: stable@vger.kernel.org # v2.6.39+
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