summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/8250_aspeed_vuart.c
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2021-05-20 11:43:33 +0930
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-20 17:14:46 +0200
commitdf8f2be2fd0b44b2cb6077068f52e05f0ac40897 (patch)
tree6981712c39d835561b8cc308de1897725d05eac7 /drivers/tty/serial/8250/8250_aspeed_vuart.c
parent3c35d2a960c0077a4cb09bf4989f45d289332ea0 (diff)
downloadlinux-df8f2be2fd0b44b2cb6077068f52e05f0ac40897.tar.gz
linux-df8f2be2fd0b44b2cb6077068f52e05f0ac40897.tar.bz2
linux-df8f2be2fd0b44b2cb6077068f52e05f0ac40897.zip
serial: 8250: Add UART_BUG_TXRACE workaround for Aspeed VUART
Aspeed Virtual UARTs directly bridge e.g. the system console UART on the LPC bus to the UART interface on the BMC's internal APB. As such there's no RS-232 signalling involved - the UART interfaces on each bus are directly connected as the producers and consumers of the one set of FIFOs. The APB in the AST2600 generally runs at 100MHz while the LPC bus peaks at 33MHz. The difference in clock speeds exposes a race in the VUART design where a Tx data burst on the APB interface can result in a byte lost on the LPC interface. The symptom is LSR[DR] remains clear on the LPC interface despite data being present in its Rx FIFO, while LSR[THRE] remains clear on the APB interface as the host has not consumed the data the BMC has transmitted. In this state, the UART has stalled and no further data can be transmitted without manual intervention (e.g. resetting the FIFOs, resulting in loss of data). The recommended work-around is to insert a read cycle on the APB interface between writes to THR. Cc: ChiaWei Wang <chiawei_wang@aspeedtech.com> Tested-by: ChiaWei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210520021334.497341-2-andrew@aj.id.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_aspeed_vuart.c')
-rw-r--r--drivers/tty/serial/8250/8250_aspeed_vuart.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c
index 61550f24a2d3..d035d08cb987 100644
--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c
+++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c
@@ -437,6 +437,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
port.port.status = UPSTAT_SYNC_FIFO;
port.port.dev = &pdev->dev;
port.port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
+ port.bugs |= UART_BUG_TXRACE;
rc = sysfs_create_group(&vuart->dev->kobj, &aspeed_vuart_attr_group);
if (rc < 0)