Skip to contentSkip to conversation

serial: 8250_dma: Convert to use uart_xmit_advance()

PATCH In review Andy Shevchenko 3 participants 8 messages Sep 9, 2022 – Sep 25, 2022 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_dma: Convert to use uart_xmit_advance()

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

---
 drivers/tty/serial/8250/8250_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_dma.c +1 -3
index d99020fd3427..b85c82616e8c 100644
@@ -26,9 +26,7 @@ static void __dma_tx_complete(void *param)
 
 	dma->tx_running = 0;
 
-	xmit->tail += dma->tx_size;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-	p->port.icount.tx += dma->tx_size;
+	uart_xmit_advance(&p->port, dma->tx_size);
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Andy Shevchenko

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

---
 drivers/tty/serial/8250/8250_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_dma.c +0 -0
index d99020fd3427..b85c82616e8c 100644

drivers/tty/serial/8250/8250_dma.c static void __dma_tx_complete(void *param) · line 32

Quoted 10 lines
drivers/tty/serial/8250/8250_dma.c +1 -3
@@ -26,9 +26,7 @@ static void __dma_tx_complete(void *param)
 
 	dma->tx_running = 0;
 
-	xmit->tail += dma->tx_size;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-	p->port.icount.tx += dma->tx_size;
+	uart_xmit_advance(&p->port, dma->tx_size);
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);

Please note though that I already have patches for almost all these but I've not just submitted the remaining ones yet.

Signature · 1 line
 i.
#2 lore raw
Quoted 4 lines · Ilpo Järvinen
Quoted 2 lines · Andy Shevchenko

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

...

Quoted 1 line

Thanks!

Quoted 2 lines

Please note though that I already have patches for almost all these but I've not just submitted the remaining ones yet.

My interest only for a limited scope of 8250 compatible UARTs, I have sent just a couple of patches and I don't think I will send more.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
In reply to Andy Shevchenko
Quoted 26 lines · Andy Shevchenko

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

---
 drivers/tty/serial/8250/8250_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_dma.c +1 -3
index d99020fd3427..b85c82616e8c 100644
@@ -26,9 +26,7 @@ static void __dma_tx_complete(void *param)
 
 	dma->tx_running = 0;
 
-	xmit->tail += dma->tx_size;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-	p->port.icount.tx += dma->tx_size;
+	uart_xmit_advance(&p->port, dma->tx_size);
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);
Signature · 1 line
2.35.1

Breaks the build :(

#4 lore raw
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Andy Shevchenko

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

---
 drivers/tty/serial/8250/8250_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_dma.c +1 -3
index d99020fd3427..b85c82616e8c 100644
@@ -26,9 +26,7 @@ static void __dma_tx_complete(void *param)
 
 	dma->tx_running = 0;
 
-	xmit->tail += dma->tx_size;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-	p->port.icount.tx += dma->tx_size;
+	uart_xmit_advance(&p->port, dma->tx_size);
 
Quoted 7 lines
Quoted 5 lines
drivers/tty/serial/8250/8250_dma.c +0 -0
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);
Signature · 1 line
2.35.1

Breaks the build :(

I'd guess it's because uart_xmit_advance() is current only in tty-linus, not in tty-next.

Signature · 1 line
 i.
#5 lore raw
Quoted 32 lines · Ilpo Järvinen
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Andy Shevchenko

uart_xmit_advance() provides a common way on how to advance the Tx queue. Use it for the sake of unification and robustness.

---
 drivers/tty/serial/8250/8250_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_dma.c +1 -3
index d99020fd3427..b85c82616e8c 100644
@@ -26,9 +26,7 @@ static void __dma_tx_complete(void *param)
 
 	dma->tx_running = 0;
 
-	xmit->tail += dma->tx_size;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-	p->port.icount.tx += dma->tx_size;
+	uart_xmit_advance(&p->port, dma->tx_size);
 
Quoted 7 lines
Quoted 5 lines
drivers/tty/serial/8250/8250_dma.c +0 -0
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);
Signature · 1 line
2.35.1

Breaks the build :(

Quoted 2 lines

I'd guess it's because uart_xmit_advance() is current only in tty-linus, not in tty-next.

Probably, can someone resend this when 6.1-rc1 is out?

thanks,

greg k-h

#6 lore raw
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Ilpo Järvinen
Quoted 1 line · Greg Kroah-Hartman

On Fri, Sep 09, 2022 at 12:11:02PM +0300, Andy Shevchenko wrote:

...

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Breaks the build :(

I'd guess it's because uart_xmit_advance() is current only in tty-linus, not in tty-next.

Probably, can someone resend this when 6.1-rc1 is out?

Sure.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 7 lines · Andy Shevchenko
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Ilpo Järvinen
Quoted 1 line · Greg Kroah-Hartman

On Fri, Sep 09, 2022 at 12:11:02PM +0300, Andy Shevchenko wrote:

...

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Breaks the build :(

I'd guess it's because uart_xmit_advance() is current only in tty-linus, not in tty-next.

Probably, can someone resend this when 6.1-rc1 is out?

Sure.

Nevermind, I took them now, thanks.

greg k-h