Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250_omap: remove wait loop from Errata i202 workaround

We were occasionally seeing the "Errata i202: timedout" on an AM335x
board when repeatedly opening and closing a UART connected to an active
sender. As new input may arrive at any time, it is possible to miss the
"RX FIFO empty" condition, forcing the loop to wait until it times out.

Nothing in the i202 Advisory states that such a wait is even necessary;
other FIFO clear functions like serial8250_clear_fifos() do not wait
either. For this reason, it seems safe to remove the wait, fixing the
mentioned issue.

Fixes: 61929cf0169d ("tty: serial: Add 8250-core based omap driver")
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20221013112339.2540767-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Matthias Schiffer and committed by
Greg Kroah-Hartman
e828e566 93810191

-17
-17
drivers/tty/serial/8250/8250_omap.c
··· 211 211 static void omap_8250_mdr1_errataset(struct uart_8250_port *up, 212 212 struct omap8250_priv *priv) 213 213 { 214 - u8 timeout = 255; 215 - 216 214 serial_out(up, UART_OMAP_MDR1, priv->mdr1); 217 215 udelay(2); 218 216 serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_XMIT | 219 217 UART_FCR_CLEAR_RCVR); 220 - /* 221 - * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and 222 - * TX_FIFO_E bit is 1. 223 - */ 224 - while (UART_LSR_THRE != (serial_in(up, UART_LSR) & 225 - (UART_LSR_THRE | UART_LSR_DR))) { 226 - timeout--; 227 - if (!timeout) { 228 - /* Should *never* happen. we warn and carry on */ 229 - dev_crit(up->port.dev, "Errata i202: timedout %x\n", 230 - serial_in(up, UART_LSR)); 231 - break; 232 - } 233 - udelay(1); 234 - } 235 218 } 236 219 237 220 static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud,