Skip to content

Commit 08a0c6d

Browse files
l1kgregkh
authored andcommitted
serial: pl010: Drop CR register reset on set_termios
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 <[email protected]> Signed-off-by: Lukas Wunner <[email protected]> Link: https://lore.kernel.org/r/fcaff16e5b1abb4cc3da5a2879ac13f278b99ed0.1641128728.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 556172f commit 08a0c6d

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/tty/serial/amba-pl010.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,11 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
446446
if ((termios->c_cflag & CREAD) == 0)
447447
uap->port.ignore_status_mask |= UART_DUMMY_RSR_RX;
448448

449-
/* first, disable everything */
450449
old_cr = readb(uap->port.membase + UART010_CR) & ~UART010_CR_MSIE;
451450

452451
if (UART_ENABLE_MS(port, termios->c_cflag))
453452
old_cr |= UART010_CR_MSIE;
454453

455-
writel(0, uap->port.membase + UART010_CR);
456-
457454
/* Set baud rate */
458455
quot -= 1;
459456
writel((quot & 0xf00) >> 8, uap->port.membase + UART010_LCRM);

0 commit comments

Comments
 (0)