Patch "serial: pl010: Drop CR register reset on set_termios" has been added to the 5.10-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: pl010: Drop CR register reset on set_termios

to the 5.10-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-pl010-drop-cr-register-reset-on-set_termios.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 85e46a962b2c31cd85c3eb3fcf895ab6c12e8ecd
Author: Lukas Wunner <lukas@xxxxxxxxx>
Date:   Sun Jan 2 18:42:44 2022 +0100

    serial: pl010: Drop CR register reset on set_termios
    
    [ Upstream commit 08a0c6dff91c965e39905cf200d22db989203ccb ]
    
    pl010_set_termios() briefly resets the CR register to zero.
    
    Where does this register write come from?
    
    The PL010 driver's IRQ handler ambauart_int() originally modified the CR
    register without holding the port spinlock.  ambauart_set_termios() also
    modified that register.  To prevent concurrent read-modify-writes by the
    IRQ handler and to prevent transmission while changing baudrate,
    ambauart_set_termios() had to disable interrupts.  That is achieved by
    writing zero to the CR register.
    
    However in 2004 the PL010 driver was amended to acquire the port
    spinlock in the IRQ handler, obviating the need to disable interrupts in
    ->set_termios():
    https://git.kernel.org/history/history/c/157c0342e591
    
    That rendered the CR register write obsolete.  Drop it.
    
    Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxx>
    Signed-off-by: Lukas Wunner <lukas@xxxxxxxxx>
    Link: https://lore.kernel.org/r/fcaff16e5b1abb4cc3da5a2879ac13f278b99ed0.1641128728.git.lukas@xxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 3284f34e9dfe1..75d61e038a775 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -448,14 +448,11 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
 	if ((termios->c_cflag & CREAD) == 0)
 		uap->port.ignore_status_mask |= UART_DUMMY_RSR_RX;
 
-	/* first, disable everything */
 	old_cr = readb(uap->port.membase + UART010_CR) & ~UART010_CR_MSIE;
 
 	if (UART_ENABLE_MS(port, termios->c_cflag))
 		old_cr |= UART010_CR_MSIE;
 
-	writel(0, uap->port.membase + UART010_CR);
-
 	/* Set baud rate */
 	quot -= 1;
 	writel((quot & 0xf00) >> 8, uap->port.membase + UART010_LCRM);



[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