]> 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)
commite6291af5318f0c28865f1d46132f6554f35bbe61
tree0e4e39b000d63c5a49d37b06f101d0f237fee73f
parentc14def96daf93a09100765f2bac649db6a895bb2
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