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

serial: atmel_serial: drop low-latency workaround

Commit 1ecc26bd2789 ("atmel_serial: split the interrupt handler") worked
around the infamous low_latency behaviour of tty_flip_buffer_push() by
dropping and reacquiring the port lock in the tasklet callback.

Since commit a9c3f68f3cd8 ("tty: Fix low_latency BUG"),
tty_flip_buffer_push() always schedules a work item to push data to the
line discipline and there's no need to keep any low_latency hacks around.

Cc: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210421095509.3024-10-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
983fe58a e9af7e36

-18
-18
drivers/tty/serial/atmel_serial.c
··· 1178 1178 1, 1179 1179 DMA_FROM_DEVICE); 1180 1180 1181 - /* 1182 - * Drop the lock here since it might end up calling 1183 - * uart_start(), which takes the lock. 1184 - */ 1185 - spin_unlock(&port->lock); 1186 1181 tty_flip_buffer_push(tport); 1187 - spin_lock(&port->lock); 1188 1182 1189 1183 atmel_uart_writel(port, ATMEL_US_IER, ATMEL_US_TIMEOUT); 1190 1184 } ··· 1570 1576 uart_insert_char(port, status, ATMEL_US_OVRE, c.ch, flg); 1571 1577 } 1572 1578 1573 - /* 1574 - * Drop the lock here since it might end up calling 1575 - * uart_start(), which takes the lock. 1576 - */ 1577 - spin_unlock(&port->lock); 1578 1579 tty_flip_buffer_push(&port->state->port); 1579 - spin_lock(&port->lock); 1580 1580 } 1581 1581 1582 1582 static void atmel_release_rx_pdc(struct uart_port *port) ··· 1655 1667 } 1656 1668 } while (head >= pdc->dma_size); 1657 1669 1658 - /* 1659 - * Drop the lock here since it might end up calling 1660 - * uart_start(), which takes the lock. 1661 - */ 1662 - spin_unlock(&port->lock); 1663 1670 tty_flip_buffer_push(tport); 1664 - spin_lock(&port->lock); 1665 1671 1666 1672 atmel_uart_writel(port, ATMEL_US_IER, 1667 1673 ATMEL_US_ENDRX | ATMEL_US_TIMEOUT);