Message ID | 20210421095509.3024-6-johan@kernel.org |
---|---|
State | New |
Headers | show |
Series | tty: drop low-latency workarounds | expand |
On Wed, Apr 21, 2021 at 11:55 AM Johan Hovold <johan@kernel.org> wrote: > Commit ead76f329f77 ("ARM: 6763/1: pl011: add optional RX DMA to PL011 > v2") added RX DMA support and also reproduced the workaround for the > infamous low_latency behaviour of tty_flip_buffer_push() by dropping and > reacquiring the port lock during receive processing. > > 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. > > Note that the port lock is also dropped in the PIO path > (see pl011_rx_chars), but it is not clear whether this is still needed > by the DMA code added by the aforementioned commit. > > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Russell King <linux@armlinux.org.uk> > Signed-off-by: Johan Hovold <johan@kernel.org> Looks like the right thing to do to me! Thanks for digging this out. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 4ead0c9048a8..78682c12156a 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -937,12 +937,10 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap, fifotaken = pl011_fifo_to_tty(uap); } - spin_unlock(&uap->port.lock); dev_vdbg(uap->port.dev, "Took %d chars from DMA buffer and %d chars from the FIFO\n", dma_count, fifotaken); tty_flip_buffer_push(port); - spin_lock(&uap->port.lock); } static void pl011_dma_rx_irq(struct uart_amba_port *uap)
Commit ead76f329f77 ("ARM: 6763/1: pl011: add optional RX DMA to PL011 v2") added RX DMA support and also reproduced the workaround for the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock during receive processing. 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. Note that the port lock is also dropped in the PIO path (see pl011_rx_chars), but it is not clear whether this is still needed by the DMA code added by the aforementioned commit. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Russell King <linux@armlinux.org.uk> Signed-off-by: Johan Hovold <johan@kernel.org> --- drivers/tty/serial/amba-pl011.c | 2 -- 1 file changed, 2 deletions(-)