linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/44] serial: atmel: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-20  9:01   ` Claudiu.Beznea
  2022-10-19  9:11 ` [PATCH 12/44] serial: clps711x: " Ilpo Järvinen
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Richard Genoud, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, linux-arm-kernel,
	linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/atmel_serial.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index bd07f79a2df9..4485f2d26b77 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -875,10 +875,7 @@ static void atmel_complete_tx_dma(void *arg)
 
 	if (chan)
 		dmaengine_terminate_all(chan);
-	xmit->tail += atmel_port->tx_len;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-
-	port->icount.tx += atmel_port->tx_len;
+	uart_xmit_advance(port, atmel_port->tx_len);
 
 	spin_lock_irq(&atmel_port->lock_tx);
 	async_tx_ack(atmel_port->desc_tx);
@@ -1471,11 +1468,7 @@ static void atmel_tx_pdc(struct uart_port *port)
 	/* nothing left to transmit? */
 	if (atmel_uart_readl(port, ATMEL_PDC_TCR))
 		return;
-
-	xmit->tail += pdc->ofs;
-	xmit->tail &= UART_XMIT_SIZE - 1;
-
-	port->icount.tx += pdc->ofs;
+	uart_xmit_advance(port, pdc->ofs);
 	pdc->ofs = 0;
 
 	/* more to transmit - setup next transfer */
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 12/44] serial: clps711x: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
  2022-10-19  9:11 ` [PATCH 11/44] serial: atmel: Use uart_xmit_advance() Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 14/44] serial: digicolor: " Ilpo Järvinen
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Alexander Shiyan,
	linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/clps711x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index 404b43a5ae33..e190dce58f46 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -166,8 +166,7 @@ static irqreturn_t uart_clps711x_int_tx(int irq, void *dev_id)
 		u32 sysflg = 0;
 
 		writew(xmit->buf[xmit->tail], port->membase + UARTDR_OFFSET);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 
 		regmap_read(s->syscon, SYSFLG_OFFSET, &sysflg);
 		if (sysflg & SYSFLG_UTXFF)
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 14/44] serial: digicolor: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
  2022-10-19  9:11 ` [PATCH 11/44] serial: atmel: Use uart_xmit_advance() Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 12/44] serial: clps711x: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19 11:30   ` Baruch Siach
  2022-10-19  9:11 ` [PATCH 17/44] serial: imx: " Ilpo Järvinen
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Baruch Siach,
	linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/digicolor-usart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
index 0c0a62346f23..ed197705f7ee 100644
--- a/drivers/tty/serial/digicolor-usart.c
+++ b/drivers/tty/serial/digicolor-usart.c
@@ -202,8 +202,7 @@ static void digicolor_uart_tx(struct uart_port *port)
 
 	while (!uart_circ_empty(xmit)) {
 		writeb(xmit->buf[xmit->tail], port->membase + UA_EMI_REC);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 
 		if (digicolor_uart_tx_full(port))
 			break;
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 17/44] serial: imx: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (2 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 14/44] serial: digicolor: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19 13:14   ` Uwe Kleine-König
  2022-10-19  9:11 ` [PATCH 22/44] serial: meson: " Ilpo Järvinen
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/imx.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 05b432dc7a85..a7548d0a1aee 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -563,8 +563,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
 		/* send xmit->buf[xmit->tail]
 		 * out the port here */
 		imx_uart_writel(sport, xmit->buf[xmit->tail], URTX0);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		sport->port.icount.tx++;
+		uart_xmit_advance(&sport->port, 1);
 	}
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -590,9 +589,7 @@ static void imx_uart_dma_tx_callback(void *data)
 	ucr1 &= ~UCR1_TXDMAEN;
 	imx_uart_writel(sport, ucr1, UCR1);
 
-	/* update the stat */
-	xmit->tail = (xmit->tail + sport->tx_bytes) & (UART_XMIT_SIZE - 1);
-	sport->port.icount.tx += sport->tx_bytes;
+	uart_xmit_advance(&sport->port, sport->tx_bytes);
 
 	dev_dbg(sport->port.dev, "we finish the TX DMA.\n");
 
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 22/44] serial: meson: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (3 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 17/44] serial: imx: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19  9:36   ` Neil Armstrong
  2022-10-19 20:42   ` Martin Blumenstingl
  2022-10-19  9:11 ` [PATCH 23/44] serial: milbeaut_usio: " Ilpo Järvinen
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, linux-arm-kernel,
	linux-amlogic, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/meson_uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 056243c12836..74110017988a 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -162,8 +162,7 @@ static void meson_uart_start_tx(struct uart_port *port)
 
 		ch = xmit->buf[xmit->tail];
 		writel(ch, port->membase + AML_UART_WFIFO);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 	}
 
 	if (!uart_circ_empty(xmit)) {
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 23/44] serial: milbeaut_usio: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (4 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 22/44] serial: meson: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 27/44] serial: rda: " Ilpo Järvinen
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Taichi Sugaya, Takao Orito,
	linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/milbeaut_usio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c
index c15e0d84dc7e..44988a2941b8 100644
--- a/drivers/tty/serial/milbeaut_usio.c
+++ b/drivers/tty/serial/milbeaut_usio.c
@@ -98,8 +98,7 @@ static void mlb_usio_tx_chars(struct uart_port *port)
 	do {
 		writew(xmit->buf[xmit->tail], port->membase + MLB_USIO_REG_DR);
 
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 		if (uart_circ_empty(xmit))
 			break;
 
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 27/44] serial: rda: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (5 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 23/44] serial: milbeaut_usio: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 28/44] serial: samsung_tty: " Ilpo Järvinen
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Manivannan Sadhasivam,
	linux-arm-kernel, linux-unisoc, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/rda-uart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c
index 0e387e2144fa..be5c842b5ba9 100644
--- a/drivers/tty/serial/rda-uart.c
+++ b/drivers/tty/serial/rda-uart.c
@@ -353,8 +353,7 @@ static void rda_uart_send_chars(struct uart_port *port)
 
 		ch = xmit->buf[xmit->tail];
 		rda_uart_write(port, ch, RDA_UART_RXTX_BUFFER);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 	}
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 28/44] serial: samsung_tty: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (6 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 27/44] serial: rda: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-21 11:48   ` Sam Protsenko
  2022-10-19  9:11 ` [PATCH 34/44] serial: stm32: " Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 43/44] serial: xuartps: " Ilpo Järvinen
  9 siblings, 1 reply; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/samsung_tty.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 77d1363029f5..7e34361a1085 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -288,7 +288,6 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
 {
 	struct s3c24xx_uart_port *ourport = to_ourport(port);
 	struct s3c24xx_uart_dma *dma = ourport->dma;
-	struct circ_buf *xmit = &port->state->xmit;
 	struct dma_tx_state state;
 	int count;
 
@@ -316,8 +315,7 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
 					DMA_TO_DEVICE);
 		async_tx_ack(dma->tx_desc);
 		count = dma->tx_bytes_requested - state.residue;
-		xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
-		port->icount.tx += count;
+		uart_xmit_advance(port, count);
 	}
 
 	ourport->tx_enabled = 0;
@@ -351,8 +349,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args)
 
 	spin_lock_irqsave(&port->lock, flags);
 
-	xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
-	port->icount.tx += count;
+	uart_xmit_advance(port, count);
 	ourport->tx_in_progress = 0;
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -916,8 +913,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
 			break;
 
 		wr_reg(port, S3C2410_UTXH, xmit->buf[xmit->tail]);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 		count--;
 	}
 
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 34/44] serial: stm32: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (7 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 28/44] serial: samsung_tty: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  2022-10-19  9:11 ` [PATCH 43/44] serial: xuartps: " Ilpo Järvinen
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Maxime Coquelin,
	Alexandre Torgue, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/stm32-usart.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index dfdbcf092fac..24def72b2565 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -596,8 +596,7 @@ static void stm32_usart_transmit_chars_pio(struct uart_port *port)
 		if (!(readl_relaxed(port->membase + ofs->isr) & USART_SR_TXE))
 			break;
 		writel_relaxed(xmit->buf[xmit->tail], port->membase + ofs->tdr);
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-		port->icount.tx++;
+		uart_xmit_advance(port, 1);
 	}
 
 	/* rely on TXE irq (mask or unmask) for sending remaining data */
@@ -673,8 +672,8 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port)
 
 	stm32_usart_set_bits(port, ofs->cr3, USART_CR3_DMAT);
 
-	xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
-	port->icount.tx += count;
+	uart_xmit_advance(port, count);
+
 	return;
 
 fallback_err:
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 43/44] serial: xuartps: Use uart_xmit_advance()
       [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
                   ` (8 preceding siblings ...)
  2022-10-19  9:11 ` [PATCH 34/44] serial: stm32: " Ilpo Järvinen
@ 2022-10-19  9:11 ` Ilpo Järvinen
  9 siblings, 0 replies; 17+ messages in thread
From: Ilpo Järvinen @ 2022-10-19  9:11 UTC (permalink / raw)
  To: linux-serial, Greg KH, Jiri Slaby, Michal Simek,
	linux-arm-kernel, linux-kernel
  Cc: Andy Shevchenko, Ilpo Järvinen

Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/xilinx_uartps.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 2eff7cff57c4..01d8027e64fd 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -326,9 +326,7 @@ static void cdns_uart_handle_tx(void *dev_id)
 	       !(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXFULL)) {
 
 		writel(xmit->buf[xmit->tail], port->membase + CDNS_UART_FIFO);
-
-		port->icount.tx++;
-		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+		uart_xmit_advance(port, 1);
 		numbytes--;
 	}
 
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 22/44] serial: meson: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 22/44] serial: meson: " Ilpo Järvinen
@ 2022-10-19  9:36   ` Neil Armstrong
  2022-10-19 20:42   ` Martin Blumenstingl
  1 sibling, 0 replies; 17+ messages in thread
From: Neil Armstrong @ 2022-10-19  9:36 UTC (permalink / raw)
  To: Ilpo Järvinen, linux-serial, Greg KH, Jiri Slaby,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	linux-arm-kernel, linux-amlogic, linux-kernel
  Cc: Andy Shevchenko

On 19/10/2022 11:11, Ilpo Järvinen wrote:
> Take advantage of the new uart_xmit_advance() helper.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>   drivers/tty/serial/meson_uart.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
> index 056243c12836..74110017988a 100644
> --- a/drivers/tty/serial/meson_uart.c
> +++ b/drivers/tty/serial/meson_uart.c
> @@ -162,8 +162,7 @@ static void meson_uart_start_tx(struct uart_port *port)
>   
>   		ch = xmit->buf[xmit->tail];
>   		writel(ch, port->membase + AML_UART_WFIFO);
> -		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> -		port->icount.tx++;
> +		uart_xmit_advance(port, 1);
>   	}
>   
>   	if (!uart_circ_empty(xmit)) {


Acked-by: Neil Armstrong <neil.armstrong@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 14/44] serial: digicolor: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 14/44] serial: digicolor: " Ilpo Järvinen
@ 2022-10-19 11:30   ` Baruch Siach
  0 siblings, 0 replies; 17+ messages in thread
From: Baruch Siach @ 2022-10-19 11:30 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: linux-serial, Greg KH, Jiri Slaby, linux-arm-kernel,
	linux-kernel, Andy Shevchenko

Hi Ilpo,

On Wed, Oct 19 2022, Ilpo Järvinen wrote:
> Take advantage of the new uart_xmit_advance() helper.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks,
baruch

> ---
>  drivers/tty/serial/digicolor-usart.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c
> index 0c0a62346f23..ed197705f7ee 100644
> --- a/drivers/tty/serial/digicolor-usart.c
> +++ b/drivers/tty/serial/digicolor-usart.c
> @@ -202,8 +202,7 @@ static void digicolor_uart_tx(struct uart_port *port)
>  
>  	while (!uart_circ_empty(xmit)) {
>  		writeb(xmit->buf[xmit->tail], port->membase + UA_EMI_REC);
> -		xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> -		port->icount.tx++;
> +		uart_xmit_advance(port, 1);
>  
>  		if (digicolor_uart_tx_full(port))
>  			break;

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 17/44] serial: imx: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 17/44] serial: imx: " Ilpo Järvinen
@ 2022-10-19 13:14   ` Uwe Kleine-König
  0 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2022-10-19 13:14 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: linux-serial, Greg KH, Jiri Slaby, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-arm-kernel, linux-kernel, Andy Shevchenko


[-- Attachment #1.1: Type: text/plain, Size: 474 bytes --]

On Wed, Oct 19, 2022 at 12:11:24PM +0300, Ilpo Järvinen wrote:
> Take advantage of the new uart_xmit_advance() helper.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards and thanks for adapting the imx driver
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 22/44] serial: meson: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 22/44] serial: meson: " Ilpo Järvinen
  2022-10-19  9:36   ` Neil Armstrong
@ 2022-10-19 20:42   ` Martin Blumenstingl
  1 sibling, 0 replies; 17+ messages in thread
From: Martin Blumenstingl @ 2022-10-19 20:42 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: linux-serial, Greg KH, Jiri Slaby, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, linux-arm-kernel, linux-amlogic, linux-kernel,
	Andy Shevchenko

On Wed, Oct 19, 2022 at 11:13 AM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> Take advantage of the new uart_xmit_advance() helper.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

That helper is a welcome improvement in my opinion. Thanks for working on this!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 11/44] serial: atmel: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 11/44] serial: atmel: Use uart_xmit_advance() Ilpo Järvinen
@ 2022-10-20  9:01   ` Claudiu.Beznea
  2022-10-20 13:06     ` Richard Genoud
  0 siblings, 1 reply; 17+ messages in thread
From: Claudiu.Beznea @ 2022-10-20  9:01 UTC (permalink / raw)
  To: ilpo.jarvinen, linux-serial, gregkh, jirislaby, richard.genoud,
	Nicolas.Ferre, alexandre.belloni, linux-arm-kernel, linux-kernel
  Cc: andriy.shevchenko

On 19.10.2022 12:11, Ilpo Järvinen wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Take advantage of the new uart_xmit_advance() helper.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>


> ---
>  drivers/tty/serial/atmel_serial.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index bd07f79a2df9..4485f2d26b77 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -875,10 +875,7 @@ static void atmel_complete_tx_dma(void *arg)
> 
>         if (chan)
>                 dmaengine_terminate_all(chan);
> -       xmit->tail += atmel_port->tx_len;
> -       xmit->tail &= UART_XMIT_SIZE - 1;
> -
> -       port->icount.tx += atmel_port->tx_len;
> +       uart_xmit_advance(port, atmel_port->tx_len);
> 
>         spin_lock_irq(&atmel_port->lock_tx);
>         async_tx_ack(atmel_port->desc_tx);
> @@ -1471,11 +1468,7 @@ static void atmel_tx_pdc(struct uart_port *port)
>         /* nothing left to transmit? */
>         if (atmel_uart_readl(port, ATMEL_PDC_TCR))
>                 return;
> -
> -       xmit->tail += pdc->ofs;
> -       xmit->tail &= UART_XMIT_SIZE - 1;
> -
> -       port->icount.tx += pdc->ofs;
> +       uart_xmit_advance(port, pdc->ofs);
>         pdc->ofs = 0;
> 
>         /* more to transmit - setup next transfer */
> --
> 2.30.2
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 11/44] serial: atmel: Use uart_xmit_advance()
  2022-10-20  9:01   ` Claudiu.Beznea
@ 2022-10-20 13:06     ` Richard Genoud
  0 siblings, 0 replies; 17+ messages in thread
From: Richard Genoud @ 2022-10-20 13:06 UTC (permalink / raw)
  To: Claudiu.Beznea, ilpo.jarvinen, linux-serial, gregkh, jirislaby,
	Nicolas.Ferre, alexandre.belloni, linux-arm-kernel, linux-kernel
  Cc: andriy.shevchenko

Le 20/10/2022 à 11:01, Claudiu.Beznea@microchip.com a écrit :
> On 19.10.2022 12:11, Ilpo Järvinen wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> Take advantage of the new uart_xmit_advance() helper.
>>
>> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> 
> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Acked-By: Richard GENOUD <richard.genoud@gmail.com>

>> ---
>>  drivers/tty/serial/atmel_serial.c | 11 ++---------
>>  1 file changed, 2 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
>> index bd07f79a2df9..4485f2d26b77 100644
>> --- a/drivers/tty/serial/atmel_serial.c
>> +++ b/drivers/tty/serial/atmel_serial.c
>> @@ -875,10 +875,7 @@ static void atmel_complete_tx_dma(void *arg)
>>
>>         if (chan)
>>                 dmaengine_terminate_all(chan);
>> -       xmit->tail += atmel_port->tx_len;
>> -       xmit->tail &= UART_XMIT_SIZE - 1;
>> -
>> -       port->icount.tx += atmel_port->tx_len;
>> +       uart_xmit_advance(port, atmel_port->tx_len);
>>
>>         spin_lock_irq(&atmel_port->lock_tx);
>>         async_tx_ack(atmel_port->desc_tx);
>> @@ -1471,11 +1468,7 @@ static void atmel_tx_pdc(struct uart_port *port)
>>         /* nothing left to transmit? */
>>         if (atmel_uart_readl(port, ATMEL_PDC_TCR))
>>                 return;
>> -
>> -       xmit->tail += pdc->ofs;
>> -       xmit->tail &= UART_XMIT_SIZE - 1;
>> -
>> -       port->icount.tx += pdc->ofs;
>> +       uart_xmit_advance(port, pdc->ofs);
>>         pdc->ofs = 0;
>>
>>         /* more to transmit - setup next transfer */
>> --
>> 2.30.2
>>
> 

Thanks !

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 28/44] serial: samsung_tty: Use uart_xmit_advance()
  2022-10-19  9:11 ` [PATCH 28/44] serial: samsung_tty: " Ilpo Järvinen
@ 2022-10-21 11:48   ` Sam Protsenko
  0 siblings, 0 replies; 17+ messages in thread
From: Sam Protsenko @ 2022-10-21 11:48 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: linux-serial, Greg KH, Jiri Slaby, Krzysztof Kozlowski,
	Alim Akhtar, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Andy Shevchenko

On Wed, 19 Oct 2022 at 11:35, Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> Take advantage of the new uart_xmit_advance() helper.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---

Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>

>  drivers/tty/serial/samsung_tty.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 77d1363029f5..7e34361a1085 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -288,7 +288,6 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
>  {
>         struct s3c24xx_uart_port *ourport = to_ourport(port);
>         struct s3c24xx_uart_dma *dma = ourport->dma;
> -       struct circ_buf *xmit = &port->state->xmit;
>         struct dma_tx_state state;
>         int count;
>
> @@ -316,8 +315,7 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
>                                         DMA_TO_DEVICE);
>                 async_tx_ack(dma->tx_desc);
>                 count = dma->tx_bytes_requested - state.residue;
> -               xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
> -               port->icount.tx += count;
> +               uart_xmit_advance(port, count);
>         }
>
>         ourport->tx_enabled = 0;
> @@ -351,8 +349,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args)
>
>         spin_lock_irqsave(&port->lock, flags);
>
> -       xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
> -       port->icount.tx += count;
> +       uart_xmit_advance(port, count);
>         ourport->tx_in_progress = 0;
>
>         if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
> @@ -916,8 +913,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
>                         break;
>
>                 wr_reg(port, S3C2410_UTXH, xmit->buf[xmit->tail]);
> -               xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
> -               port->icount.tx++;
> +               uart_xmit_advance(port, 1);
>                 count--;
>         }
>
> --
> 2.30.2
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-10-21 11:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20221019091151.6692-1-ilpo.jarvinen@linux.intel.com>
2022-10-19  9:11 ` [PATCH 11/44] serial: atmel: Use uart_xmit_advance() Ilpo Järvinen
2022-10-20  9:01   ` Claudiu.Beznea
2022-10-20 13:06     ` Richard Genoud
2022-10-19  9:11 ` [PATCH 12/44] serial: clps711x: " Ilpo Järvinen
2022-10-19  9:11 ` [PATCH 14/44] serial: digicolor: " Ilpo Järvinen
2022-10-19 11:30   ` Baruch Siach
2022-10-19  9:11 ` [PATCH 17/44] serial: imx: " Ilpo Järvinen
2022-10-19 13:14   ` Uwe Kleine-König
2022-10-19  9:11 ` [PATCH 22/44] serial: meson: " Ilpo Järvinen
2022-10-19  9:36   ` Neil Armstrong
2022-10-19 20:42   ` Martin Blumenstingl
2022-10-19  9:11 ` [PATCH 23/44] serial: milbeaut_usio: " Ilpo Järvinen
2022-10-19  9:11 ` [PATCH 27/44] serial: rda: " Ilpo Järvinen
2022-10-19  9:11 ` [PATCH 28/44] serial: samsung_tty: " Ilpo Järvinen
2022-10-21 11:48   ` Sam Protsenko
2022-10-19  9:11 ` [PATCH 34/44] serial: stm32: " Ilpo Järvinen
2022-10-19  9:11 ` [PATCH 43/44] serial: xuartps: " Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).