Patch "serial: 8250_omap: remove wait loop from Errata i202 workaround" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     serial-8250_omap-remove-wait-loop-from-errata-i202-w.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 12a60ff8a8ff3b36ae77b1338da65f6ae386d065
Author: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
Date:   Thu Oct 13 13:23:39 2022 +0200

    serial: 8250_omap: remove wait loop from Errata i202 workaround
    
    [ Upstream commit e828e56684d61b17317e0cfdef83791fa61cb76b ]
    
    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@xxxxxxxxxxxxxxx>
    Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221013112339.2540767-1-matthias.schiffer@xxxxxxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index e32afaa94d36..e4e6b7cb3a16 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -160,27 +160,10 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
 static void omap_8250_mdr1_errataset(struct uart_8250_port *up,
 				     struct omap8250_priv *priv)
 {
-	u8 timeout = 255;
-
 	serial_out(up, UART_OMAP_MDR1, priv->mdr1);
 	udelay(2);
 	serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_XMIT |
 			UART_FCR_CLEAR_RCVR);
-	/*
-	 * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and
-	 * TX_FIFO_E bit is 1.
-	 */
-	while (UART_LSR_THRE != (serial_in(up, UART_LSR) &
-				(UART_LSR_THRE | UART_LSR_DR))) {
-		timeout--;
-		if (!timeout) {
-			/* Should *never* happen. we warn and carry on */
-			dev_crit(up->port.dev, "Errata i202: timedout %x\n",
-				 serial_in(up, UART_LSR));
-			break;
-		}
-		udelay(1);
-	}
 }
 
 static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux