]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250_aspeed_vuart: add PORT_ASPEED_VUART port type
authorZev Weiss <zev@bewilderbeest.net>
Fri, 11 Feb 2022 00:42:03 +0000 (16:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:45 +0000 (14:23 +0200)
commit75f9843668960a4f5cae5d169212c6b6a1bd15ed
tree2faac69ea050ba8990f8a7c423c1ab934b8a8e26
parentfb817f8ef6e1425811c637f3b0a71196c4f3b702
serial: 8250_aspeed_vuart: add PORT_ASPEED_VUART port type

[ Upstream commit d75afc269d2b3273cfbaaec72d3d1a669d87fbd0 ]

Commit 8a149bc2cd23 ("serial: 8250_aspeed_vuart: use UPF_IOREMAP to
set up register mapping") fixed a bug that had, as a side-effect,
prevented the 8250_aspeed_vuart driver from enabling the VUART's
FIFOs.  However, fixing that (and hence enabling the FIFOs) has in
turn revealed what appears to be a hardware bug in the ASPEED VUART in
which the host-side THRE bit doesn't get if the BMC-side receive FIFO
trigger level is set to anything but one byte.  This causes problems
for polled-mode writes from the host -- for example, Linux kernel
console writes proceed at a glacial pace (less than 100 bytes per
second) because the write path waits for a 10ms timeout to expire
after every character instead of being able to continue on to the next
character upon seeing THRE asserted.  (GRUB behaves similarly.)

As a workaround, introduce a new port type for the ASPEED VUART that's
identical to PORT_16550A as it had previously been using, but with
UART_FCR_R_TRIG_00 instead to set the receive FIFO trigger level to
one byte, which (experimentally) seems to avoid the problematic THRE
behavior.

Fixes: 8a149bc2cd23 ("serial: 8250_aspeed_vuart: use UPF_IOREMAP to set up register mapping")
Tested-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Link: https://lore.kernel.org/r/20220211004203.14915-1-zev@bewilderbeest.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_aspeed_vuart.c
drivers/tty/serial/8250/8250_port.c
include/uapi/linux/serial_core.h