All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan@kernel.org>,
	Richard Genoud <richard.genoud@gmail.com>
Subject: [PATCH 09/26] serial: atmel_serial: drop low-latency workaround
Date: Wed, 21 Apr 2021 11:54:52 +0200	[thread overview]
Message-ID: <20210421095509.3024-10-johan@kernel.org> (raw)
In-Reply-To: <20210421095509.3024-1-johan@kernel.org>

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>
---
 drivers/tty/serial/atmel_serial.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index a24e5c2b30bc..058886d9045b 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1178,13 +1178,7 @@ static void atmel_rx_from_dma(struct uart_port *port)
 			       1,
 			       DMA_FROM_DEVICE);
 
-	/*
-	 * Drop the lock here since it might end up calling
-	 * uart_start(), which takes the lock.
-	 */
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	atmel_uart_writel(port, ATMEL_US_IER, ATMEL_US_TIMEOUT);
 }
@@ -1576,13 +1570,7 @@ static void atmel_rx_from_ring(struct uart_port *port)
 		uart_insert_char(port, status, ATMEL_US_OVRE, c.ch, flg);
 	}
 
-	/*
-	 * Drop the lock here since it might end up calling
-	 * uart_start(), which takes the lock.
-	 */
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static void atmel_release_rx_pdc(struct uart_port *port)
@@ -1667,13 +1655,7 @@ static void atmel_rx_from_pdc(struct uart_port *port)
 		}
 	} while (head >= pdc->dma_size);
 
-	/*
-	 * Drop the lock here since it might end up calling
-	 * uart_start(), which takes the lock.
-	 */
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	atmel_uart_writel(port, ATMEL_US_IER,
 			  ATMEL_US_ENDRX | ATMEL_US_TIMEOUT);
-- 
2.26.3


  parent reply	other threads:[~2021-04-21  9:55 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  9:54 [PATCH 00/26] tty: drop low-latency workarounds Johan Hovold
2021-04-21  9:54 ` [PATCH 01/26] tty: mxser: drop low-latency workaround Johan Hovold
2021-04-22  5:59   ` Jiri Slaby
2021-04-21  9:54 ` [PATCH 02/26] serial: altera_jtaguart: " Johan Hovold
2021-04-21 10:03   ` Tobias Klauser
2021-04-21  9:54 ` [PATCH 03/26] serial: altera_uart: " Johan Hovold
2021-04-21 10:03   ` Tobias Klauser
2021-04-21  9:54 ` [PATCH 04/26] serial: amba-pl010: " Johan Hovold
2021-04-21  9:54 ` [PATCH 05/26] serial: amba-pl011: " Johan Hovold
2021-04-22  0:18   ` Linus Walleij
2021-04-21  9:54 ` [PATCH 06/26] serial: apbuart: " Johan Hovold
2021-04-21  9:54 ` [PATCH 07/26] serial: ar933x: " Johan Hovold
2021-04-21  9:54 ` [PATCH 08/26] serial: arc_uart: " Johan Hovold
2021-04-21  9:54 ` Johan Hovold [this message]
2021-04-21  9:54 ` [PATCH 10/26] serial: bcm63xx: " Johan Hovold
2021-04-21  9:54 ` [PATCH 11/26] serial: icom: " Johan Hovold
2021-04-21  9:54 ` [PATCH 12/26] serial: lpc32xx_hs: " Johan Hovold
2021-04-21  9:54 ` [PATCH 13/26] serial: mcf: " Johan Hovold
2021-04-21  9:54 ` [PATCH 14/26] serial: meson: " Johan Hovold
2021-04-21  9:54 ` [PATCH 15/26] serial: mpc52xx_uart: " Johan Hovold
2021-04-21  9:54 ` [PATCH 16/26] serial: msm_serial: " Johan Hovold
2021-04-21 17:44   ` Bjorn Andersson
2021-04-21  9:55 ` [PATCH 17/26] serial: owl: " Johan Hovold
2021-04-21  9:55 ` [PATCH 18/26] serial: rda: " Johan Hovold
2021-04-21  9:55 ` [PATCH 19/26] serial: rp2: " Johan Hovold
2021-04-21  9:55 ` [PATCH 20/26] serial: sa1100: " Johan Hovold
2021-04-21  9:55 ` [PATCH 21/26] serial: txx9: " Johan Hovold
2021-04-21  9:55 ` [PATCH 22/26] serial: sifive: " Johan Hovold
2021-04-21  9:55 ` [PATCH 23/26] serial: sunsu: " Johan Hovold
2021-04-21 16:56   ` David Miller
2021-04-21  9:55 ` [PATCH 24/26] serial: timbuart: " Johan Hovold
2021-04-21  9:55 ` [PATCH 25/26] serial: vt8500: " Johan Hovold
2021-04-21  9:55 ` [PATCH 26/26] serial: xilinx_uartps: " Johan Hovold
2021-04-22 10:09 ` [PATCH 00/26] tty: drop low-latency workarounds Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210421095509.3024-10-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=richard.genoud@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.