Skip to contentSkip to conversation

tty: drop low-latency workarounds

PATCH In review Johan Hovold 7 participants 34 messages Apr 21, 2021 – Apr 22, 2021

Subsystems (18)
lore
Share & tools
lore
#3 lore raw

PATCH 2/26 serial: altera_jtaguart: drop low-latency workaround

In reply to Johan Hovold

Commit 53dd0ba7a6f4 ("tty: serial: altera_jtag: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/altera_jtaguart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/altera_jtaguart.c +0 -2
index d0ca9cf29b62..23c4e0e79694 100644
@@ -131,9 +131,7 @@ static void altera_jtaguart_rx_chars(struct altera_jtaguart *pp)
 		uart_insert_char(port, 0, 0, ch, flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static void altera_jtaguart_tx_chars(struct altera_jtaguart *pp)
Signature · 1 line
2.26.3
#0 lore raw

cover tty: drop low-latency workarounds

The infamous low_latency behaviour of tty_flip_buffer_push(), which meant that data could be pushed to the line discipline immediately instead of being deferred to a work queue, was finally removed in 2014.

Since then there's no need for drivers to keep hacks to temporarily drop the port lock during receive processing but this pattern has been reproduced in later added drivers nonetheless.

Note that several of these workarounds were added by a series posted in 2013, which ended up being merged despite having completely nonsensical commit messages. As it turned out, it was just the RT patch set which effectively enabled the low_latency flag for serial drivers that did not handle it.

There's of course nothing wrong releasing the port lock before calling tty_flip_buffer_push(), and some drivers still do after this series, but let's get rid of the completely unnecessary unlock-and-reacquire pattern.

Johan

Johan Hovold (26):
tty: mxser: drop low-latency workaround
serial: altera_jtaguart: drop low-latency workaround
serial: altera_uart: drop low-latency workaround
serial: amba-pl010: drop low-latency workaround
serial: amba-pl011: drop low-latency workaround
serial: apbuart: drop low-latency workaround
serial: ar933x: drop low-latency workaround
serial: arc_uart: drop low-latency workaround
serial: atmel_serial: drop low-latency workaround
serial: bcm63xx: drop low-latency workaround
serial: icom: drop low-latency workaround
serial: lpc32xx_hs: drop low-latency workaround
serial: mcf: drop low-latency workaround
serial: meson: drop low-latency workaround
serial: mpc52xx_uart: drop low-latency workaround
serial: msm_serial: drop low-latency workaround
serial: owl: drop low-latency workaround
serial: rda: drop low-latency workaround
serial: rp2: drop low-latency workaround
serial: sa1100: drop low-latency workaround
serial: txx9: drop low-latency workaround
serial: sifive: drop low-latency workaround
serial: sunsu: drop low-latency workaround
serial: timbuart: drop low-latency workaround
serial: vt8500: drop low-latency workaround
serial: xilinx_uartps: drop low-latency workaround

 drivers/tty/mxser.c                  |  7 -------
 drivers/tty/serial/altera_jtaguart.c |  2 --
 drivers/tty/serial/altera_uart.c     |  2 --
 drivers/tty/serial/amba-pl010.c      |  2 --
 drivers/tty/serial/amba-pl011.c      |  2 --
 drivers/tty/serial/apbuart.c         |  2 --
 drivers/tty/serial/ar933x_uart.c     |  2 --
 drivers/tty/serial/arc_uart.c        |  2 --
 drivers/tty/serial/atmel_serial.c    | 18 ------------------
 drivers/tty/serial/bcm63xx_uart.c    |  2 --
 drivers/tty/serial/icom.c            |  2 --
 drivers/tty/serial/lpc32xx_hs.c      |  2 --
 drivers/tty/serial/mcf.c             |  2 --
 drivers/tty/serial/meson_uart.c      |  2 --
 drivers/tty/serial/mpc52xx_uart.c    |  2 --
 drivers/tty/serial/msm_serial.c      |  4 ----
 drivers/tty/serial/owl-uart.c        |  2 --
 drivers/tty/serial/rda-uart.c        |  2 --
 drivers/tty/serial/rp2.c             |  2 --
 drivers/tty/serial/sa1100.c          |  2 --
 drivers/tty/serial/serial_txx9.c     |  4 ++--
 drivers/tty/serial/sifive.c          |  2 --
 drivers/tty/serial/sunsu.c           |  4 ----
 drivers/tty/serial/timbuart.c        |  2 --
 drivers/tty/serial/vt8500_serial.c   |  2 --
 drivers/tty/serial/xilinx_uartps.c   |  3 +--
 26 files changed, 3 insertions(+), 77 deletions(-)
Signature · 1 line
2.26.3
#7 lore raw

PATCH 4/26 serial: amba-pl010: drop low-latency workaround

Commit 2389b272168c ("[ARM] 4417/1: Serial: Fix AMBA drivers locking") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler.

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.

---
 drivers/tty/serial/amba-pl010.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/amba-pl010.c +0 -2
index 3f96edfe569c..e744b953ca34 100644
@@ -159,9 +159,7 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
 	ignore_char:
 		status = readb(uap->port.membase + UART01x_FR);
 	}
-	spin_unlock(&uap->port.lock);
 	tty_flip_buffer_push(&uap->port.state->port);
-	spin_lock(&uap->port.lock);
 }
 
 static void pl010_tx_chars(struct uart_amba_port *uap)
Signature · 1 line
2.26.3
#8 lore raw

PATCH 5/26 serial: amba-pl011: drop low-latency workaround

In reply to Johan Hovold

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 <[email protected]>
Cc Russell King <[email protected]>
---
 drivers/tty/serial/amba-pl011.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/amba-pl011.c +0 -2
index 4ead0c9048a8..78682c12156a 100644
@@ -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)
Signature · 1 line
2.26.3
#5 lore raw

PATCH 3/26 serial: altera_uart: drop low-latency workaround

In reply to Johan Hovold

Commit dd085ed8ef6c ("tty: serial: altera: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/altera_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/altera_uart.c +0 -2
index 0e487ce091ac..7c5f4e966b59 100644
@@ -243,9 +243,7 @@ static void altera_uart_rx_chars(struct altera_uart *pp)
 				 flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static void altera_uart_tx_chars(struct altera_uart *pp)
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/26 tty: mxser: drop low-latency workaround

In reply to Johan Hovold

Commit 67d2bc58afdd ("Char: mxser_new, fix recursive locking") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler.

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.

---
 drivers/tty/mxser.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/tty/mxser.c +0 -7
index 2d8e76263a25..16a852ecbe8a 100644
@@ -2155,14 +2155,7 @@ static void mxser_receive_chars(struct tty_struct *tty,
 	port->mon_data.rxcnt += cnt;
 	port->mon_data.up_rxcnt += cnt;
 
-	/*
-	 * We are called from an interrupt context with &port->slock
-	 * being held. Drop it temporarily in order to prevent
-	 * recursive locking.
-	 */
-	spin_unlock(&port->slock);
 	tty_flip_buffer_push(&port->port);
-	spin_lock(&port->slock);
 }
 
 static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *port)
Signature · 1 line
2.26.3
#13 lore raw

PATCH 9/26 serial: atmel_serial: drop low-latency workaround

In reply to Johan Hovold

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 <[email protected]>
---
 drivers/tty/serial/atmel_serial.c | 18 ------------------
 1 file changed, 18 deletions(-)
drivers/tty/serial/atmel_serial.c +0 -18
index a24e5c2b30bc..058886d9045b 100644
@@ -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);
Signature · 1 line
2.26.3
#10 lore raw

PATCH 6/26 serial: apbuart: drop low-latency workaround

In reply to Johan Hovold

Commit 78d34d75c84d ("tty: serial: apbuart: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/apbuart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/apbuart.c +0 -2
index e8d56e899ec7..d8c937bdf3f9 100644
@@ -117,9 +117,7 @@ static void apbuart_rx_chars(struct uart_port *port)
 		status = UART_GET_STATUS(port);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static void apbuart_tx_chars(struct uart_port *port)
Signature · 1 line
2.26.3
#11 lore raw

PATCH 7/26 serial: ar933x: drop low-latency workaround

In reply to Johan Hovold

Commit b16c8e3eed12 ("tty: serial: ar933x: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/ar933x_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/ar933x_uart.c +0 -2
index c2be7cf91399..4379ca4842ae 100644
@@ -385,9 +385,7 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
 			tty_insert_flip_char(port, ch, TTY_NORMAL);
 	} while (max_count-- > 0);
 
-	spin_unlock(&up->port.lock);
 	tty_flip_buffer_push(port);
-	spin_lock(&up->port.lock);
 }
 
 static void ar933x_uart_tx_chars(struct ar933x_uart_port *up)
Signature · 1 line
2.26.3
#12 lore raw

PATCH 8/26 serial: arc_uart: drop low-latency workaround

In reply to Johan Hovold

Commit 3fa1200851c7 ("tty: serial: arc: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/arc_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/arc_uart.c +0 -2
index 17c3fc398fc6..1a9444b6b57e 100644
@@ -236,9 +236,7 @@ static void arc_serial_rx_chars(struct uart_port *port, unsigned int status)
 		if (!(uart_handle_sysrq_char(port, ch)))
 			uart_insert_char(port, status, RXOERR, ch, flg);
 
-		spin_unlock(&port->lock);
 		tty_flip_buffer_push(&port->state->port);
-		spin_lock(&port->lock);
 	} while (!((status = UART_GET_STATUS(port)) & RXEMPTY));
 }
 
Signature · 1 line
2.26.3
#15 lore raw

PATCH 11/26 serial: icom: drop low-latency workaround

In reply to Johan Hovold

Commit 5faf75d7fed2 ("tty: serial: icom: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/icom.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/icom.c +0 -2
index 94af7a5ea497..9e9abfc4824a 100644
@@ -829,9 +829,7 @@ static void recv_interrupt(u16 port_int_reg, struct icom_port *icom_port)
 	}
 	icom_port->next_rcv = rcv_buff;
 
-	spin_unlock(&icom_port->uart_port.lock);
 	tty_flip_buffer_push(port);
-	spin_lock(&icom_port->uart_port.lock);
 }
 
 static void process_interrupt(u16 port_int_reg,
Signature · 1 line
2.26.3
#16 lore raw

PATCH 12/26 serial: lpc32xx_hs: drop low-latency workaround

In reply to Johan Hovold

Commit ec128510905c ("tty: serial: lpc32xx_hs: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/lpc32xx_hs.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/lpc32xx_hs.c +0 -2
index 1fa098d7aec4..b199d7859961 100644
@@ -273,9 +273,7 @@ static void __serial_lpc32xx_rx(struct uart_port *port)
 		tmp = readl(LPC32XX_HSUART_FIFO(port->membase));
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 }
 
 static void __serial_lpc32xx_tx(struct uart_port *port)
Signature · 1 line
2.26.3
#22 lore raw

PATCH 17/26 serial: owl: drop low-latency workaround

In reply to Johan Hovold

The owl driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had been removed years before the driver was added by commit fc60a8b675bd ("tty: serial: owl: Implement console driver").

Specifically, 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.

---
 drivers/tty/serial/owl-uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/owl-uart.c +0 -2
index abc6042f0378..91f1eb0058d7 100644
@@ -247,9 +247,7 @@ static void owl_uart_receive_chars(struct uart_port *port)
 		stat = owl_uart_read(port, OWL_UART_STAT);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static irqreturn_t owl_uart_irq(int irq, void *dev_id)
Signature · 1 line
2.26.3
#17 lore raw

PATCH 13/26 serial: mcf: drop low-latency workaround

In reply to Johan Hovold

Commit 5275ad70fed3 ("tty: serial: mcf: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/mcf.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/mcf.c +0 -2
index 09c88c48fb7b..c7cec7d03620 100644
@@ -319,9 +319,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
 		uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 /****************************************************************************/
Signature · 1 line
2.26.3
#18 lore raw

PATCH 14/26 serial: meson: drop low-latency workaround

In reply to Johan Hovold

The meson driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had already been removed by the time the driver was added by commit ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver").

Specifically, 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.

---
 drivers/tty/serial/meson_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/meson_uart.c +0 -2
index 69eeef9edfa5..529cd0289056 100644
@@ -226,9 +226,7 @@ static void meson_receive_chars(struct uart_port *port)
 
 	} while (!(readl(port->membase + AML_UART_STATUS) & AML_UART_RX_EMPTY));
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 }
 
 static irqreturn_t meson_uart_interrupt(int irq, void *dev_id)
Signature · 1 line
2.26.3
#20 lore raw

PATCH 16/26 serial: msm_serial: drop low-latency workaround

In reply to Johan Hovold

Commit f77232dab25b ("tty: serial: msm: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/msm_serial.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/tty/serial/msm_serial.c +0 -4
index 770c182e2208..fcef7a961430 100644
@@ -757,9 +757,7 @@ static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr)
 		count -= r_count;
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	if (misr & (UART_IMR_RXSTALE))
 		msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR);
@@ -819,9 +817,7 @@ static void msm_handle_rx(struct uart_port *port)
 			tty_insert_flip_char(tport, c, flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 }
 
 static void msm_handle_tx_pio(struct uart_port *port, unsigned int tx_count)
Signature · 1 line
2.26.3
#14 lore raw

PATCH 10/26 serial: bcm63xx: drop low-latency workaround

In reply to Johan Hovold

Commit b4d499241c34 ("tty: serial: bcm63xx: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/bcm63xx_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/bcm63xx_uart.c +0 -2
index 5674da2b76f0..5fb0e84f7fd1 100644
@@ -294,9 +294,7 @@ static void bcm_uart_do_rx(struct uart_port *port)
 
 	} while (--max_count);
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tty_port);
-	spin_lock(&port->lock);
 }
 
 /*
Signature · 1 line
2.26.3
#19 lore raw

PATCH 15/26 serial: mpc52xx_uart: drop low-latency workaround

In reply to Johan Hovold

Commit fbe543b412ce ("Fix a potential issue in mpc52xx uart driver") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler.

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.

---
 drivers/tty/serial/mpc52xx_uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/mpc52xx_uart.c +0 -2
index af1700445251..2704dc988e4a 100644
@@ -1421,9 +1421,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
 		}
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	return psc_ops->raw_rx_rdy(port);
 }
Signature · 1 line
2.26.3
#23 lore raw

PATCH 18/26 serial: rda: drop low-latency workaround

In reply to Johan Hovold

The rda driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push(), which had been removed years before the driver was added by commit c10b13325ced ("tty: serial: Add RDA8810PL UART driver").

Specifically, 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.

---
 drivers/tty/serial/rda-uart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/rda-uart.c +0 -2
index 85366e059258..d550d8fa2fab 100644
@@ -398,9 +398,7 @@ static void rda_uart_receive_chars(struct uart_port *port)
 		status = rda_uart_read(port, RDA_UART_STATUS);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 static irqreturn_t rda_interrupt(int irq, void *dev_id)
Signature · 1 line
2.26.3
#24 lore raw

PATCH 19/26 serial: rp2: drop low-latency workaround

In reply to Johan Hovold

Commit de7053c77123 ("tty: serial: rp2: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/rp2.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/rp2.c +0 -2
index 5690c09cc041..d60abffab70e 100644
@@ -424,9 +424,7 @@ static void rp2_rx_chars(struct rp2_uart_port *up)
 		up->port.icount.rx++;
 	}
 
-	spin_unlock(&up->port.lock);
 	tty_flip_buffer_push(port);
-	spin_lock(&up->port.lock);
 }
 
 static void rp2_tx_chars(struct rp2_uart_port *up)
Signature · 1 line
2.26.3
#25 lore raw

PATCH 20/26 serial: sa1100: drop low-latency workaround

In reply to Johan Hovold

Commit 53e0e6706c76 ("tty: serial: sa1100: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/sa1100.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/sa1100.c +0 -2
index f5fab1dd96bc..697b6a002a16 100644
@@ -223,9 +223,7 @@ sa1100_rx_chars(struct sa1100_port *sport)
 			 UTSR0_TO_SM(UART_GET_UTSR0(sport));
 	}
 
-	spin_unlock(&sport->port.lock);
 	tty_flip_buffer_push(&sport->port.state->port);
-	spin_lock(&sport->port.lock);
 }
 
 static void sa1100_tx_chars(struct sa1100_port *sport)
Signature · 1 line
2.26.3
#28 lore raw

PATCH 23/26 serial: sunsu: drop low-latency workaround

In reply to Johan Hovold

The sunsu driver has been carrying a workaround for the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock in the interrupt handler since 2004.

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 "David S. Miller" <[email protected]>
---
 drivers/tty/serial/sunsu.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/tty/serial/sunsu.c +0 -4
index 319e5ceb6130..12c2468f2b0e 100644
@@ -466,12 +466,8 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id)
 		if (status & UART_LSR_THRE)
 			transmit_chars(up);
 
-		spin_unlock_irqrestore(&up->port.lock, flags);
-
 		tty_flip_buffer_push(&up->port.state->port);
 
-		spin_lock_irqsave(&up->port.lock, flags);
-
 	} while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT));
 
 	spin_unlock_irqrestore(&up->port.lock, flags);
Signature · 1 line
2.26.3
#26 lore raw

PATCH 21/26 serial: txx9: drop low-latency workaround

In reply to Johan Hovold

Commit f5ee56cc184e ("[PATCH] txx9 serial update") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler.

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.

---
 drivers/tty/serial/serial_txx9.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/serial_txx9.c +2 -2
index 7a07e7272de1..0a7e5b74bc1d 100644
@@ -330,9 +330,9 @@ receive_chars(struct uart_txx9_port *up, unsigned int *status)
 		up->port.ignore_status_mask = next_ignore_status_mask;
 		disr = sio_in(up, TXX9_SIDISR);
 	} while (!(disr & TXX9_SIDISR_UVALID) && (max_count-- > 0));
-	spin_unlock(&up->port.lock);
+
 	tty_flip_buffer_push(&up->port.state->port);
-	spin_lock(&up->port.lock);
+
 	*status = disr;
 }
 
Signature · 1 line
2.26.3
#27 lore raw

PATCH 22/26 serial: sifive: drop low-latency workaround

In reply to Johan Hovold

The sifive driver has always carried an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which had been removed years before the driver was added by commit 45c054d0815b ("tty:
serial: add driver for the SiFive UART").

Specifically, 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 Palmer Dabbelt <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/tty/serial/sifive.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/sifive.c +0 -2
index 328d5a78792f..0ac0371f943b 100644
@@ -448,9 +448,7 @@ static void __ssp_receive_chars(struct sifive_serial_port *ssp)
 		uart_insert_char(&ssp->port, 0, 0, ch, TTY_NORMAL);
 	}
 
-	spin_unlock(&ssp->port.lock);
 	tty_flip_buffer_push(&ssp->port.state->port);
-	spin_lock(&ssp->port.lock);
 }
 
 /**
Signature · 1 line
2.26.3
#30 lore raw

PATCH 24/26 serial: timbuart: drop low-latency workaround

In reply to Johan Hovold

The timbuart driver has always carried a workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which required not holding the port lock when the low_latency flag was set.

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.

---
 drivers/tty/serial/timbuart.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/timbuart.c +0 -2
index 2126e6e6dfd1..08941eabe7b1 100644
@@ -87,9 +87,7 @@ static void timbuart_rx_chars(struct uart_port *port)
 		tty_insert_flip_char(tport, ch, TTY_NORMAL);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	dev_dbg(port->dev, "%s - total read %d bytes\n",
 		__func__, port->icount.rx);
Signature · 1 line
2.26.3
#31 lore raw

PATCH 25/26 serial: vt8500: drop low-latency workaround

In reply to Johan Hovold

Commit de49df58366f ("tty: serial: vt8500: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

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.

---
 drivers/tty/serial/vt8500_serial.c | 2 --
 1 file changed, 2 deletions(-)
drivers/tty/serial/vt8500_serial.c +0 -2
index 764e992438b2..c5edd56ff830 100644
@@ -184,9 +184,7 @@ static void handle_rx(struct uart_port *port)
 			tty_insert_flip_char(tport, c, flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 }
 
 static void handle_tx(struct uart_port *port)
Signature · 1 line
2.26.3
#32 lore raw

PATCH 26/26 serial: xilinx_uartps: drop low-latency workaround

In reply to Johan Hovold

Commit c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic") reworked the driver interrupt processing but also, without comment, added an unnecessary workaround for the infamous low_latency behaviour of tty_flip_buffer_push() which had been removed years before.

Specifically, 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.

---
 drivers/tty/serial/xilinx_uartps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/xilinx_uartps.c +1 -2
index a14c5d996473..67a2db621e2b 100644
@@ -301,9 +301,8 @@ static void cdns_uart_handle_rx(void *dev_id, unsigned int isrstatus)
 		tty_insert_flip_char(&port->state->port, data, status);
 		isrstatus = 0;
 	}
-	spin_unlock(&port->lock);
+
 	tty_flip_buffer_push(&port->state->port);
-	spin_lock(&port->lock);
 }
 
 /**
Signature · 1 line
2.26.3
maintainer Acked-by on v1 2/26
#4 lore raw

Re: [PATCH 02/26] serial: altera_jtaguart: drop low-latency workaround

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

Commit 53dd0ba7a6f4 ("tty: serial: altera_jtag: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

Quoted 8 lines

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.

Thanks

maintainer Acked-by on v1 3/26
#6 lore raw

Re: [PATCH 03/26] serial: altera_uart: drop low-latency workaround

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

Commit dd085ed8ef6c ("tty: serial: altera: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

Quoted 8 lines

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.

Thanks

maintainer Acked-by on v1 23/26
#29 lore raw

Re: [PATCH 23/26] serial: sunsu: drop low-latency workaround

In reply to Johan Hovold

From: Johan Hovold <[email protected]>
Date: Wed, 21 Apr 2021 11:55:06 +0200

Quoted 10 lines

The sunsu driver has been carrying a workaround for the infamous low_latency behaviour of tty_flip_buffer_push() by dropping and reacquiring the port lock in the interrupt handler since 2004.

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 "David S. Miller" <[email protected]>
Acked-by on v1 16/26
#21 lore raw

Re: [PATCH 16/26] serial: msm_serial: drop low-latency workaround

In reply to Johan Hovold
Quoted 16 lines · Johan Hovold

Commit f77232dab25b ("tty: serial: msm: drop uart_port->lock before calling tty_flip_buffer_push()") claimed to address a locking issue but only provided a dubious lockdep splat from an unrelated driver, which in the end turned out to be due a broken local change carried by the author.

Unfortunately these patches were merged before the issue had been analysed properly so the commit messages makes no sense whatsoever.

The real issue was first seen on RT which at the time effectively always set the low_latency flag for all serial drivers by patching tty_flip_buffer_push(). This in turn revealed that many drivers did not handle the infamous low_latency behaviour which meant that data was pushed immediately to the line discipline instead of being deferred to a work queue.

Quoted 8 lines

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.

Regards,
Bjorn

Quoted 32 lines
---
 drivers/tty/serial/msm_serial.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/tty/serial/msm_serial.c +0 -4
index 770c182e2208..fcef7a961430 100644
@@ -757,9 +757,7 @@ static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr)
 		count -= r_count;
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 
 	if (misr & (UART_IMR_RXSTALE))
 		msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR);
@@ -819,9 +817,7 @@ static void msm_handle_rx(struct uart_port *port)
 			tty_insert_flip_char(tport, c, flag);
 	}
 
-	spin_unlock(&port->lock);
 	tty_flip_buffer_push(tport);
-	spin_lock(&port->lock);
 }
 
 static void msm_handle_tx_pio(struct uart_port *port, unsigned int tx_count)
Signature · 1 line
2.26.3
Reviewed-by on v1 5/26
#9 lore raw

Re: [PATCH 05/26] serial: amba-pl011: drop low-latency workaround

In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

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.

Quoted 7 lines

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 <[email protected]>
Cc Russell King <[email protected]>

Looks like the right thing to do to me! Thanks for digging this out.

Yours,
Linus Walleij

maintainer Reviewed-by on v1 1/26
#2 lore raw

Re: [PATCH 01/26] tty: mxser: drop low-latency workaround

In reply to Johan Hovold
Quoted 10 lines · Johan Hovold

Commit 67d2bc58afdd ("Char: mxser_new, fix recursive locking") worked around the infamous low_latency behaviour of tty_flip_buffer_push() by simply dropping and reacquiring the port lock in the interrupt handler.

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.

Quoted 14 lines
---
  drivers/tty/mxser.c | 7 -------
  1 file changed, 7 deletions(-)
drivers/tty/mxser.c +0 -1
index 2d8e76263a25..16a852ecbe8a 100644
@@ -2155,14 +2155,7 @@ static void mxser_receive_chars(struct tty_struct *tty,
  	port->mon_data.rxcnt += cnt;
  	port->mon_data.up_rxcnt += cnt;
 
-	/*

drivers/tty/mxser.c static void mxser_receive_chars(struct tty_struct *tty, · line 2161

Quoted 10 lines
drivers/tty/mxser.c +0 -6
-	 * We are called from an interrupt context with &port->slock
-	 * being held. Drop it temporarily in order to prevent
-	 * recursive locking.
-	 */
-	spin_unlock(&port->slock);
  	tty_flip_buffer_push(&port->port);
-	spin_lock(&port->slock);
  }
 
  static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *port)

thanks,

Signature · 1 line
js
#33 lore raw
In reply to Johan Hovold
Quoted 14 lines · Johan Hovold

The infamous low_latency behaviour of tty_flip_buffer_push(), which meant that data could be pushed to the line discipline immediately instead of being deferred to a work queue, was finally removed in 2014.

Since then there's no need for drivers to keep hacks to temporarily drop the port lock during receive processing but this pattern has been reproduced in later added drivers nonetheless.

Note that several of these workarounds were added by a series posted in 2013, which ended up being merged despite having completely nonsensical commit messages. As it turned out, it was just the RT patch set which effectively enabled the low_latency flag for serial drivers that did not handle it.

Quoted 4 lines

There's of course nothing wrong releasing the port lock before calling tty_flip_buffer_push(), and some drivers still do after this series, but let's get rid of the completely unnecessary unlock-and-reacquire pattern.

Many thanks for cleaning up this old crud, all now applied.

greg k-h