serial: Convert drivers to use uart_xmit_advance()
Subsystems (28)
cover serial: Convert drivers to use uart_xmit_advance()
The uart_xmit_advance() helper was created for managing the xmit tail index and accounting. It simplifies one the most common operation in almost every serial driver. Convert most of the drivers to use the new helper.
I've tried to pick the drivers such that these shouldn't collide with the ones Jiri's tx loop rewrite series is touching (unless he has something hidden beyond what has been on the list).
Ilpo Järvinen (44):
serial: dz: Use uart_xmit_advance()
serial: men_z135_uart: Use uart_xmit_advance()
serial: msm: Use uart_xmit_advance()
serial: pch_uart: Use uart_xmit_advance()
serial: sc16is7xx: Use uart_xmit_advance()
serial: 8250_bcm7271: Use uart_xmit_advance()
serial: 8250: Use uart_xmit_advance()
serial: pl011: Use uart_xmit_advance()
serial: ar933x: Use uart_xmit_advance()
serial: arc: Use uart_xmit_advance()
serial: atmel: Use uart_xmit_advance()
serial: clps711x: Use uart_xmit_advance()
serial: cpm_uart: Use uart_xmit_advance()
serial: digicolor: Use uart_xmit_advance()
serial: linflexuart: Use uart_xmit_advance()
serial: fsl_lpuart: Use uart_xmit_advance()
serial: imx: Use uart_xmit_advance()
serial: ip22zilog: Use uart_xmit_advance()
serial: liteuart: Use uart_xmit_advance()
serial: max3100: Use uart_xmit_advance()
serial: max310x: Use uart_xmit_advance()
serial: meson: Use uart_xmit_advance()
serial: milbeaut_usio: Use uart_xmit_advance()
serial: mvebu-uart: Use uart_xmit_advance()
serial: pic32: Use uart_xmit_advance()
serial: pmac_zilog: Use uart_xmit_advance()
serial: rda: Use uart_xmit_advance()
serial: samsung_tty: Use uart_xmit_advance()
serial: sb1250-duart: Use uart_xmit_advance()
serial: sccnxp: Use uart_xmit_advance()
serial: tegra: Use uart_xmit_advance()
serial: sh-sci: Use uart_xmit_advance()
serial: sprd: Use uart_xmit_advance()
serial: stm32: Use uart_xmit_advance()
serial: sunhv: Use uart_xmit_advance()
serial: sunplus-uart: Use uart_xmit_advance()
serial: sunsab: Use uart_xmit_advance()
serial: sunsu: Use uart_xmit_advance()
serial: sunzilog: Use uart_xmit_advance()
serial: timbuart: Use uart_xmit_advance()
serial: uartlite: Use uart_xmit_advance()
serial: ucc_uart: Use uart_xmit_advance()
serial: xuartps: Use uart_xmit_advance()
serial: zs: Use uart_xmit_advance()
drivers/tty/serial/8250/8250_bcm7271.c | 4 +--- drivers/tty/serial/8250/8250_port.c | 3 +-- drivers/tty/serial/amba-pl011.c | 3 +-- drivers/tty/serial/ar933x_uart.c | 3 +-- drivers/tty/serial/arc_uart.c | 3 +-- drivers/tty/serial/atmel_serial.c | 11 ++--------- drivers/tty/serial/clps711x.c | 3 +-- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 3 +-- drivers/tty/serial/digicolor-usart.c | 3 +-- drivers/tty/serial/dz.c | 3 +-- drivers/tty/serial/fsl_linflexuart.c | 3 +-- drivers/tty/serial/fsl_lpuart.c | 7 ++----- drivers/tty/serial/imx.c | 7 ++----- drivers/tty/serial/ip22zilog.c | 6 ++---- drivers/tty/serial/liteuart.c | 3 +-- drivers/tty/serial/max3100.c | 4 +--- drivers/tty/serial/max310x.c | 5 +---- drivers/tty/serial/men_z135_uart.c | 5 +---- drivers/tty/serial/meson_uart.c | 3 +-- drivers/tty/serial/milbeaut_usio.c | 3 +-- drivers/tty/serial/msm_serial.c | 11 +++-------- drivers/tty/serial/mvebu-uart.c | 3 +-- drivers/tty/serial/pch_uart.c | 12 ++++-------- drivers/tty/serial/pic32_uart.c | 3 +-- drivers/tty/serial/pmac_zilog.c | 6 ++---- drivers/tty/serial/rda-uart.c | 3 +-- drivers/tty/serial/samsung_tty.c | 10 +++------- drivers/tty/serial/sb1250-duart.c | 3 +-- drivers/tty/serial/sc16is7xx.c | 5 +---- drivers/tty/serial/sccnxp.c | 3 +-- drivers/tty/serial/serial-tegra.c | 3 +-- drivers/tty/serial/sh-sci.c | 5 +---- drivers/tty/serial/sprd_serial.c | 7 ++----- drivers/tty/serial/stm32-usart.c | 7 +++---- drivers/tty/serial/sunhv.c | 6 ++---- drivers/tty/serial/sunplus-uart.c | 4 +--- drivers/tty/serial/sunsab.c | 6 ++---- drivers/tty/serial/sunsu.c | 3 +-- drivers/tty/serial/sunzilog.c | 6 ++---- drivers/tty/serial/timbuart.c | 3 +-- drivers/tty/serial/uartlite.c | 3 +-- drivers/tty/serial/ucc_uart.c | 3 +-- drivers/tty/serial/xilinx_uartps.c | 4 +--- drivers/tty/serial/zs.c | 3 +-- 44 files changed, 62 insertions(+), 145 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/44 serial: dz: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/dz.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/dz.c +1 -2
@@ -279,9 +279,8 @@ static inline void dz_transmit_chars(struct dz_mux *mux)* so we go one char at a time) :-< */ tmp = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (DZ_XMIT_SIZE -1 );dz_out (dport,DZ_TDR , tmp); - dport->port.icount.tx++; +uart_xmit_advance (&dport->port,1 );if (uart_circ_chars_pending (xmit) <DZ_WAKEUP_CHARS )uart_write_wakeup (&dport->port);
Signature · 1 line
2.30.2
PATCH 2/44 serial: men_z135_uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/men_z135_uart.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/men_z135_uart.c +1 -4
@@ -352,11 +352,8 @@ static void men_z135_handle_tx(struct men_z135_port *uart) n =min (n, s);memcpy_toio (port->membase +MEN_Z135_TX_RAM , &xmit->buf[xmit->tail], n); - xmit->tail = (xmit->tail + n) & (UART_XMIT_SIZE -1 ); -iowrite32 (n &0x3ff , port->membase +MEN_Z135_TX_CTRL ); - - port->icount.tx += n; +uart_xmit_advance (port, n);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);
Signature · 1 line
2.30.2
PATCH 3/44 serial: msm: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/msm_serial.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/tty/serial/msm_serial.c +3 -8
@@ -464,12 +464,9 @@ static void msm_complete_tx_dma(void *args) } count = dma->count - state.residue; - port->icount.tx += count; +uart_xmit_advance (port, count); dma->count =0 ; - xmit->tail += count; - xmit->tail &=UART_XMIT_SIZE -1 ; -/* Restore "Tx FIFO below watermark" interrupt */ msm_port->imr |=MSM_UART_IMR_TXLEV ;msm_write (port, msm_port->imr,MSM_UART_IMR );
@@ -866,13 +863,11 @@ static void msm_handle_tx_pio(struct uart_port *port, unsigned int tx_count)else num_chars =1 ; -for (i =0 ; i < num_chars; i++) { +for (i =0 ; i < num_chars; i++) buf[i] = xmit->buf[xmit->tail + i]; - port->icount.tx++; - }iowrite32_rep (tf, buf,1 ); - xmit->tail = (xmit->tail + num_chars) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port, num_chars); tf_pointer += num_chars; }
Signature · 1 line
2.30.2
PATCH 4/44 serial: pch_uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/pch_uart.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/tty/serial/pch_uart.c +4 -8
@@ -738,15 +738,12 @@ static void pch_dma_tx_complete(void *arg) {struct eg20t_port *priv = arg;struct uart_port *port = &priv->port; -struct circ_buf *xmit = &port->state->xmit;struct scatterlist *sg = priv->sg_tx_p;int i; -for (i =0 ; i < priv->nent; i++, sg++) { - xmit->tail +=sg_dma_len (sg); - port->icount.tx +=sg_dma_len (sg); - } - xmit->tail &=UART_XMIT_SIZE -1 ; +for (i =0 ; i < priv->nent; i++, sg++) +uart_xmit_advance (port,sg_dma_len (sg)); +async_tx_ack (priv->desc_tx);dma_unmap_sg (port->dev, sg, priv->orig_nent,DMA_TO_DEVICE ); priv->tx_dma_use =0 ;
@@ -843,8 +840,7 @@ static unsigned int handle_tx(struct eg20t_port *priv)while (!uart_tx_stopped (port) && !uart_circ_empty (xmit) && fifo_size) {iowrite8 (xmit->buf[xmit->tail], priv->membase +PCH_UART_THR ); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); fifo_size--; tx_empty =0 ; }
Signature · 1 line
2.30.2
Re: [PATCH 04/44] serial: pch_uart: Use uart_xmit_advance()
Quoted 1 line · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.
Quoted 41 lines
Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/pch_uart.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)drivers/tty/serial/pch_uart.c +4
-8@@ -738,15 +738,12 @@ static void pch_dma_tx_complete(void *arg) {struct eg20t_port *priv = arg;struct uart_port *port = &priv->port; -struct circ_buf *xmit = &port->state->xmit;struct scatterlist *sg = priv->sg_tx_p;int i; -for (i =0 ; i < priv->nent; i++, sg++) { - xmit->tail +=sg_dma_len (sg); - port->icount.tx +=sg_dma_len (sg); - } - xmit->tail &=UART_XMIT_SIZE -1 ; +for (i =0 ; i < priv->nent; i++, sg++) +uart_xmit_advance (port,sg_dma_len (sg)); +async_tx_ack (priv->desc_tx);dma_unmap_sg (port->dev, sg, priv->orig_nent,DMA_TO_DEVICE ); priv->tx_dma_use =0 ;@@ -843,8 +840,7 @@ static unsigned int handle_tx(struct eg20t_port *priv)while (!uart_tx_stopped (port) && !uart_circ_empty (xmit) && fifo_size) {iowrite8 (xmit->buf[xmit->tail], priv->membase +PCH_UART_THR ); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); fifo_size--; tx_empty =0 ; }Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 5/44 serial: sc16is7xx: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sc16is7xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sc16is7xx.c +1 -4
@@ -686,13 +686,10 @@ static void sc16is7xx_handle_tx(struct uart_port *port) } to_send = (to_send > txlen) ? txlen : to_send; -/* Add data to send */ - port->icount.tx += to_send; -/* Convert to linear buffer */ for (i =0 ; i < to_send; ++i) { s->buf[i] = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port,1 ); }sc16is7xx_fifo_write (port, to_send);
Signature · 1 line
2.30.2
Re: [PATCH 05/44] serial: sc16is7xx: Use uart_xmit_advance()
Quoted 1 line · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.
Quoted 27 lines
Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/sc16is7xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/tty/serial/sc16is7xx.c +1
-4@@ -686,13 +686,10 @@ static void sc16is7xx_handle_tx(struct uart_port *port) } to_send = (to_send > txlen) ? txlen : to_send; -/* Add data to send */ - port->icount.tx += to_send; -/* Convert to linear buffer */ for (i =0 ; i < to_send; ++i) { s->buf[i] = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port,1 ); }sc16is7xx_fifo_write (port, to_send);Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 6/44 serial: 8250_bcm7271: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/8250/8250_bcm7271.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/8250/8250_bcm7271.c +1 -3
@@ -425,9 +425,7 @@ static int brcmuart_tx_dma(struct uart_8250_port *p) priv->dma.tx_err =0 ;memcpy (priv->tx_buf, &xmit->buf[xmit->tail], tx_size); - xmit->tail += tx_size; - xmit->tail &=UART_XMIT_SIZE -1 ; - p->port.icount.tx += tx_size; +uart_xmit_advance (&p->port, tx_size);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&p->port);
Signature · 1 line
2.30.2
PATCH 7/44 serial: 8250: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/8250/8250_port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/8250/8250_port.c +1 -2
@@ -1842,8 +1842,7 @@ void serial8250_tx_chars(struct uart_8250_port *up)*/ serial_in (up,UART_SCR ); } - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );if (uart_circ_empty (xmit))break ; if ((up->capabilities & UART_CAP_HFIFO) &&
Signature · 1 line
2.30.2
Re: [PATCH 07/44] serial: 8250: Use uart_xmit_advance()
Quoted 1 line · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.
Quoted 22 lines
Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/8250/8250_port.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/tty/serial/8250/8250_port.c +1
-2@@ -1842,8 +1842,7 @@ void serial8250_tx_chars(struct uart_8250_port *up)*/ serial_in (up,UART_SCR ); } - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );if (uart_circ_empty (xmit))break ; if ((up->capabilities & UART_CAP_HFIFO) &&Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 8/44 serial: pl011: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/amba-pl011.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/amba-pl011.c +1 -2
@@ -677,8 +677,7 @@ static int pl011_dma_tx_refill(struct uart_amba_port *uap)* Now we know that DMA will fire, so advance the ring buffer * with the stuff we just dispatched. */ - xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE -1 ); - uap->port.icount.tx += count; +uart_xmit_advance (&uap->port, count);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&uap->port);
Signature · 1 line
2.30.2
PATCH 9/44 serial: ar933x: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/ar933x_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/ar933x_uart.c +1 -2
@@ -425,8 +425,7 @@ static void ar933x_uart_tx_chars(struct ar933x_uart_port *up)ar933x_uart_putc (up, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 ); }while (--count >0 );if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )
Signature · 1 line
2.30.2
PATCH 10/44 serial: arc: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/arc_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/arc_uart.c +1 -2
@@ -166,8 +166,7 @@ static void arc_serial_tx_chars(struct uart_port *port) sent =1 ; }else if (!uart_circ_empty (xmit)) { ch = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );while (!(UART_GET_STATUS (port) &TXEMPTY ))cpu_relax ();UART_SET_DATA (port, ch);
Signature · 7 lines
2.30.2 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
PATCH 11/44 serial: atmel: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/atmel_serial.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/tty/serial/atmel_serial.c +2 -9
@@ -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 */
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 11/44] serial: atmel: Use uart_xmit_advance()
Quoted 5 lines · Ilpo Järvinen
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 <[email protected]>
Quoted 36 lines
--- drivers/tty/serial/atmel_serial.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)drivers/tty/serial/atmel_serial.c +2
-10@@ -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
Richard Genoud
Acked-byRe: [PATCH 11/44] serial: atmel: Use uart_xmit_advance()
Le 20/10/2022 à 11:01, [email protected] a écrit :
Quoted 8 lines · Ilpo Järvinen
Quoted 5 lines
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 <[email protected]>Reviewed-by Claudiu Beznea <[email protected]>
Quoted 32 lines
Quoted 32 lines
--- drivers/tty/serial/atmel_serial.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)drivers/tty/serial/atmel_serial.c +2
-9@@ -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 ;
Quoted 5 lines
Quoted 4 lines
drivers/tty/serial/atmel_serial.c +0
-1/* more to transmit - setup next transfer */ --2.30.2
Thanks !
PATCH 12/44 serial: clps711x: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/clps711x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/clps711x.c +1 -2
@@ -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 )
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 13/44 serial: cpm_uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/cpm_uart/cpm_uart_core.c +1 -2
@@ -684,8 +684,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) p =cpm2cpu_addr (in_be32 (&bdp->cbd_bufaddr), pinfo);while (count < pinfo->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); count++;if (xmit->head == xmit->tail)break ;
Signature · 1 line
2.30.2
PATCH 14/44 serial: digicolor: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/digicolor-usart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/digicolor-usart.c +1 -2
@@ -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 ;
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 14/44] serial: digicolor: Use uart_xmit_advance()
Hi Ilpo,
Quoted 3 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>
Thanks,
baruch
Quoted 18 lines
--- drivers/tty/serial/digicolor-usart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/tty/serial/digicolor-usart.c +1
-2@@ -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 ;
Signature · 8 lines
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernelPATCH 15/44 serial: linflexuart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/fsl_linflexuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/fsl_linflexuart.c +1 -2
@@ -178,8 +178,7 @@ static inline void linflex_transmit_buffer(struct uart_port *sport)while (!uart_circ_empty (xmit)) {linflex_put_char (sport, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - sport->icount.tx++; +uart_xmit_advance (sport,1 ); }if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )
Signature · 1 line
2.30.2
PATCH 16/44 serial: fsl_lpuart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/fsl_lpuart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -5
@@ -535,9 +535,7 @@ static void lpuart_dma_tx_complete(void *arg)dma_unmap_sg (chan->device->dev, sgl, sport->dma_tx_nents,DMA_TO_DEVICE ); - xmit->tail = (xmit->tail + sport->dma_tx_bytes) & (UART_XMIT_SIZE -1 ); - - sport->port.icount.tx += sport->dma_tx_bytes; +uart_xmit_advance (&sport->port, sport->dma_tx_bytes); sport->dma_tx_in_progress = false;spin_unlock_irqrestore (&sport->port.lock, flags);
@@ -792,8 +790,7 @@ static inline void lpuart32_transmit_buffer(struct lpuart_port *sport) txcnt &=UARTWATER_COUNT_MASK ;while (!uart_circ_empty (xmit) && (txcnt < sport->txfifo_size)) {lpuart32_write (&sport->port, xmit->buf[xmit->tail],UARTDATA ); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - sport->port.icount.tx++; +uart_xmit_advance (&sport->port,1 ); txcnt =lpuart32_read (&sport->port,UARTWATER ); txcnt = txcnt >>UARTWATER_TXCNT_OFF ; txcnt &=UARTWATER_COUNT_MASK ;
Signature · 1 line
2.30.2
PATCH 17/44 serial: imx: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/imx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/tty/serial/imx.c +2 -5
@@ -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" );
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 17/44] serial: imx: Use uart_xmit_advance()
Quoted 3 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>
Best regards and thanks for adapting the imx driver Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 18/44 serial: ip22zilog: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/ip22zilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/ip22zilog.c +2 -4
@@ -409,8 +409,7 @@ static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up,ZSDELAY ();ZS_WSYNC (channel); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 );if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&up->port);
@@ -609,8 +608,7 @@ static void ip22zilog_start_tx(struct uart_port *port)ZSDELAY ();ZS_WSYNC (channel); - 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 )uart_write_wakeup (&up->port);
Signature · 1 line
2.30.2
PATCH 19/44 serial: liteuart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/liteuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/liteuart.c +1 -2
@@ -136,8 +136,7 @@ static void liteuart_start_tx(struct uart_port *port) }else if (!uart_circ_empty (xmit)) {while (xmit->head != xmit->tail) { ch = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );liteuart_putchar (port, ch); } }
Signature · 1 line
2.30.2
Re: [PATCH 19/44] serial: liteuart: Use uart_xmit_advance()
Quoted 12 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/liteuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/tty/serial/liteuart.c +0
-0
drivers/tty/serial/liteuart.c static void liteuart_start_tx(struct uart_port *port) · line 139
Quoted 6 lines
drivers/tty/serial/liteuart.c +1
-2@@ -136,8 +136,7 @@ static void liteuart_start_tx(struct uart_port *port) }else if (!uart_circ_empty (xmit)) {while (xmit->head != xmit->tail) { ch = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );
Thanks,
--Gabriel
Quoted 6 lines
drivers/tty/serial/liteuart.c +0
-0liteuart_putchar (port, ch); } }Signature · 1 line
2.30.2
PATCH 20/44 serial: max3100: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/max3100.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/max3100.c +1 -3
@@ -292,9 +292,7 @@ static void max3100_work(struct work_struct *w) }else if (!uart_circ_empty (xmit) && !uart_tx_stopped (&s->port)) { tx = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & - (UART_XMIT_SIZE -1 ); - s->port.icount.tx++; +uart_xmit_advance (&s->port,1 ); }if (tx !=0xffff ) {max3100_calc_parity (s, &tx);
Signature · 1 line
2.30.2
PATCH 21/44 serial: max310x: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/max310x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/max310x.c +1 -4
@@ -787,10 +787,7 @@ static void max310x_handle_tx(struct uart_port *port) }else {max310x_batch_write (port, xmit->buf + xmit->tail, to_send); } - -/* Add data to send */ - port->icount.tx += to_send; - xmit->tail = (xmit->tail + to_send) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port, to_send); }if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )
Signature · 1 line
2.30.2
Re: [PATCH 21/44] serial: max310x: Use uart_xmit_advance()
Quoted 1 line · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.
Quoted 24 lines
Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/max310x.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/tty/serial/max310x.c +1
-4@@ -787,10 +787,7 @@ static void max310x_handle_tx(struct uart_port *port) }else {max310x_batch_write (port, xmit->buf + xmit->tail, to_send); } - -/* Add data to send */ - port->icount.tx += to_send; - xmit->tail = (xmit->tail + to_send) & (UART_XMIT_SIZE -1 ); +uart_xmit_advance (port, to_send); }if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 22/44 serial: meson: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/meson_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/meson_uart.c +1 -2
@@ -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)) {
Signature · 7 lines
2.30.2 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH 22/44] serial: meson: Use uart_xmit_advance()
Quoted 12 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/meson_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/tty/serial/meson_uart.c +0
-0
drivers/tty/serial/meson_uart.c static void meson_uart_start_tx(struct uart_port *port) · line 168
Quoted 9 lines
drivers/tty/serial/meson_uart.c +1
-2@@ -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)) {
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Re: [PATCH 22/44] serial: meson: Use uart_xmit_advance()
In reply to Ilpo JärvinenQuoted 4 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>
That helper is a welcome improvement in my opinion. Thanks for working on this!
PATCH 23/44 serial: milbeaut_usio: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/milbeaut_usio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/milbeaut_usio.c +1 -2
@@ -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;
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 24/44 serial: mvebu-uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/mvebu-uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/mvebu-uart.c +1 -2
@@ -223,8 +223,7 @@ static void mvebu_uart_start_tx(struct uart_port *port)if (IS_EXTENDED (port) && !uart_circ_empty (xmit)) {writel (xmit->buf[xmit->tail], port->membase +UART_TSH (port)); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); } ctl =readl (port->membase +UART_INTR (port));
Signature · 1 line
2.30.2
Re: [PATCH 24/44] serial: mvebu-uart: Use uart_xmit_advance()
Quoted 3 lines · On Wednesday 19 October 2022 12:11:31 Ilpo Järvinen wrote:
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>
Quoted 21 lines
--- drivers/tty/serial/mvebu-uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/tty/serial/mvebu-uart.c +1
-2@@ -223,8 +223,7 @@ static void mvebu_uart_start_tx(struct uart_port *port)if (IS_EXTENDED (port) && !uart_circ_empty (xmit)) {writel (xmit->buf[xmit->tail], port->membase +UART_TSH (port)); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); } ctl =readl (port->membase +UART_INTR (port));Signature · 1 line
2.30.2
PATCH 25/44 serial: pic32: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/pic32_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/pic32_uart.c +1 -2
@@ -376,8 +376,7 @@ static void pic32_uart_do_tx(struct uart_port *port)pic32_uart_writel (sport,PIC32_UART_TX , c); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );if (uart_circ_empty (xmit))break ;if (--max_count ==0 )
Signature · 1 line
2.30.2
PATCH 26/44 serial: pmac_zilog: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/pmac_zilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/pmac_zilog.c +2 -4
@@ -410,8 +410,7 @@ static void pmz_transmit_chars(struct uart_pmac_port *uap)write_zsdata (uap, xmit->buf[xmit->tail]);zssync (uap); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - uap->port.icount.tx++; +uart_xmit_advance (&uap->port,1 );if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&uap->port);
@@ -627,8 +626,7 @@ static void pmz_start_tx(struct uart_port *port)return ;write_zsdata (uap, xmit->buf[xmit->tail]);zssync (uap); - 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 )uart_write_wakeup (&uap->port);
Signature · 1 line
2.30.2
PATCH 27/44 serial: rda: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/rda-uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/rda-uart.c +1 -2
@@ -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 )
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 28/44 serial: samsung_tty: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/samsung_tty.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/tty/serial/samsung_tty.c +3 -7
@@ -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--; }
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH 28/44] serial: samsung_tty: Use uart_xmit_advance()
Quoted 5 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>---
Quoted 48 lines
drivers/tty/serial/samsung_tty.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)drivers/tty/serial/samsung_tty.c +3
-8@@ -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
PATCH 29/44 serial: sb1250-duart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sb1250-duart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/sb1250-duart.c +1 -2
@@ -399,8 +399,7 @@ static void sbd_transmit_chars(struct sbd_port *sport)/* Send char. */ if (!stop_tx) {write_sbdchn (sport,R_DUART_TX_HOLD , xmit->buf[xmit->tail]); - 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 )uart_write_wakeup (&sport->port);
Signature · 1 line
2.30.2
PATCH 30/44 serial: sccnxp: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sccnxp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/sccnxp.c +1 -2
@@ -468,8 +468,7 @@ static void sccnxp_handle_tx(struct uart_port *port)break ;sccnxp_port_write (port,SCCNXP_THR_REG , xmit->buf[xmit->tail]); - 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 )
Signature · 1 line
2.30.2
PATCH 31/44 serial: tegra: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/serial-tegra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/serial-tegra.c +1 -2
@@ -496,8 +496,7 @@ static void tegra_uart_fill_tx_fifo(struct tegra_uart_port *tup, int max_bytes)break ; }tegra_uart_write (tup, xmit->buf[xmit->tail],UART_TX ); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - tup->uport.icount.tx++; +uart_xmit_advance (&tup->uport,1 ); } }
Signature · 1 line
2.30.2
Re: [PATCH 31/44] serial: tegra: Use uart_xmit_advance()
Quoted 6 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>--- drivers/tty/serial/serial-tegra.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Looks good:
PATCH 32/44 serial: sh-sci: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sh-sci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/tty/serial/sh-sci.c +1 -4
@@ -1181,10 +1181,7 @@ static void sci_dma_tx_complete(void *arg)spin_lock_irqsave (&port->lock, flags); - xmit->tail += s->tx_dma_len; - xmit->tail &=UART_XMIT_SIZE -1 ; - - port->icount.tx += s->tx_dma_len; +uart_xmit_advance (port, s->tx_dma_len);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);
Signature · 1 line
2.30.2
PATCH 33/44 serial: sprd: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sprd_serial.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/tty/serial/sprd_serial.c +2 -5
@@ -206,7 +206,6 @@ static void sprd_stop_tx_dma(struct uart_port *port) {struct sprd_uart_port *sp = container_of(port, struct sprd_uart_port, port); -struct circ_buf *xmit = &port->state->xmit;struct dma_tx_state state;u32 trans_len;
@@ -215,8 +214,7 @@ static void sprd_stop_tx_dma(struct uart_port *port)dmaengine_tx_status (sp->tx_dma.chn, sp->tx_dma.cookie, &state);if (state.residue) { trans_len = state.residue - sp->tx_dma.phys_addr; - xmit->tail = (xmit->tail + trans_len) & (UART_XMIT_SIZE -1 ); - port->icount.tx += trans_len; +uart_xmit_advance (port, trans_len);dma_unmap_single (port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len,DMA_TO_DEVICE ); }
@@ -253,8 +251,7 @@ static void sprd_complete_tx_dma(void *data)dma_unmap_single (port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len,DMA_TO_DEVICE ); - xmit->tail = (xmit->tail + sp->tx_dma.trans_len) & (UART_XMIT_SIZE -1 ); - port->icount.tx += sp->tx_dma.trans_len; +uart_xmit_advance (port, sp->tx_dma.trans_len);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);
Signature · 1 line
2.30.2
Re: [PATCH 33/44] serial: sprd: Use uart_xmit_advance()
Hi,
Quoted 3 lines · Ilpo Järvinen
Take advantage of the new
uart_xmit_advance()helper.Signed-off-by Ilpo Järvinen <[email protected]>
LGTM. Thanks.
Quoted 36 lines
--- drivers/tty/serial/sprd_serial.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/tty/serial/sprd_serial.c +2
-5@@ -206,7 +206,6 @@ static void sprd_stop_tx_dma(struct uart_port *port) {struct sprd_uart_port *sp = container_of(port, struct sprd_uart_port, port); -struct circ_buf *xmit = &port->state->xmit;struct dma_tx_state state;u32 trans_len;@@ -215,8 +214,7 @@ static void sprd_stop_tx_dma(struct uart_port *port)dmaengine_tx_status (sp->tx_dma.chn, sp->tx_dma.cookie, &state);if (state.residue) { trans_len = state.residue - sp->tx_dma.phys_addr; - xmit->tail = (xmit->tail + trans_len) & (UART_XMIT_SIZE -1 ); - port->icount.tx += trans_len; +uart_xmit_advance (port, trans_len);dma_unmap_single (port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len,DMA_TO_DEVICE ); }@@ -253,8 +251,7 @@ static void sprd_complete_tx_dma(void *data)dma_unmap_single (port->dev, sp->tx_dma.phys_addr, sp->tx_dma.trans_len,DMA_TO_DEVICE ); - xmit->tail = (xmit->tail + sp->tx_dma.trans_len) & (UART_XMIT_SIZE -1 ); - port->icount.tx += sp->tx_dma.trans_len; +uart_xmit_advance (port, sp->tx_dma.trans_len);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);
PATCH 34/44 serial: stm32: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/stm32-usart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/tty/serial/stm32-usart.c +3 -4
@@ -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:
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 35/44 serial: sunhv: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sunhv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/sunhv.c +2 -4
@@ -47,8 +47,7 @@ static void transmit_chars_putchar(struct uart_port *port, struct circ_buf *xmitif (status !=HV_EOK )break ; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); } }
@@ -63,8 +62,7 @@ static void transmit_chars_write(struct uart_port *port, struct circ_buf *xmit) status =sun4v_con_write (ra, len, &sent);if (status !=HV_EOK )break ; - xmit->tail = (xmit->tail + sent) & (UART_XMIT_SIZE -1 ); - port->icount.tx += sent; +uart_xmit_advance (port, sent); } }
Signature · 1 line
2.30.2
PATCH 36/44 serial: sunplus-uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sunplus-uart.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/sunplus-uart.c +1 -3
@@ -216,9 +216,7 @@ static void transmit_chars(struct uart_port *port)do {sp_uart_put_char (port, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail +1 ) %UART_XMIT_SIZE ; - port->icount.tx++; - +uart_xmit_advance (port,1 );if (uart_circ_empty (xmit))break ; }while (sunplus_tx_buf_not_full (port));
Signature · 1 line
2.30.2
PATCH 37/44 serial: sunsab: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sunsab.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/sunsab.c +2 -4
@@ -266,8 +266,7 @@ static void transmit_chars(struct uart_sunsab_port *up,for (i =0 ; i < up->port.fifosize; i++) {writeb (xmit->buf[xmit->tail], &up->regs->w.xfifo[i]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 );if (uart_circ_empty (xmit))break ; }
@@ -453,8 +452,7 @@ static void sunsab_start_tx(struct uart_port *port)for (i =0 ; i < up->port.fifosize; i++) {writeb (xmit->buf[xmit->tail], &up->regs->w.xfifo[i]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 );if (uart_circ_empty (xmit))break ; }
Signature · 1 line
2.30.2
PATCH 38/44 serial: sunsu: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sunsu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/sunsu.c +1 -2
@@ -417,8 +417,7 @@ static void transmit_chars(struct uart_sunsu_port *up) count = up->port.fifosize;do {serial_out (up,UART_TX , xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 );if (uart_circ_empty (xmit))break ; }while (--count >0 );
Signature · 1 line
2.30.2
PATCH 39/44 serial: sunzilog: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/sunzilog.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/sunzilog.c +2 -4
@@ -508,8 +508,7 @@ static void sunzilog_transmit_chars(struct uart_sunzilog_port *up,ZSDELAY ();ZS_WSYNC (channel); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - up->port.icount.tx++; +uart_xmit_advance (&up->port,1 );if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&up->port);
@@ -709,8 +708,7 @@ static void sunzilog_start_tx(struct uart_port *port)ZSDELAY ();ZS_WSYNC (channel); - 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 )uart_write_wakeup (&up->port);
Signature · 1 line
2.30.2
PATCH 40/44 serial: timbuart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/timbuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/timbuart.c +1 -2
@@ -101,8 +101,7 @@ static void timbuart_tx_chars(struct uart_port *port) !uart_circ_empty(xmit)) {iowrite8 (xmit->buf[xmit->tail], port->membase +TIMBUART_TXFIFO ); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); } dev_dbg(port->dev,
Signature · 1 line
2.30.2
PATCH 41/44 serial: uartlite: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/uartlite.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/uartlite.c +1 -2
@@ -203,8 +203,7 @@ static int ulite_transmit(struct uart_port *port, int stat)return 0 ;uart_out32 (xmit->buf[xmit->tail],ULITE_TX , port); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 );/* wake up */ if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )
Signature · 1 line
2.30.2
PATCH 42/44 serial: ucc_uart: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/ucc_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/ucc_uart.c +1 -2
@@ -372,8 +372,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) p =qe2cpu_addr (be32_to_cpu (bdp->buf), qe_port);while (count < qe_port->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - port->icount.tx++; +uart_xmit_advance (port,1 ); count++;if (xmit->head == xmit->tail)break ;
Signature · 1 line
2.30.2
PATCH 43/44 serial: xuartps: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/xilinx_uartps.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/tty/serial/xilinx_uartps.c +1 -3
@@ -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--; }
Signature · 7 lines
2.30.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 44/44 serial: zs: Use uart_xmit_advance()
In reply to Ilpo JärvinenTake advantage of the new uart_xmit_advance() helper.
--- drivers/tty/serial/zs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tty/serial/zs.c +1 -2
@@ -623,8 +623,7 @@ static void zs_raw_transmit_chars(struct zs_port *zport)/* Send char. */ write_zsdata (zport, xmit->buf[xmit->tail]); - xmit->tail = (xmit->tail +1 ) & (UART_XMIT_SIZE -1 ); - zport->port.icount.tx++; +uart_xmit_advance (&zport->port,1 );if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (&zport->port);
Signature · 1 line
2.30.2
Jiri Slaby
maintainerQuoted 3 lines · Ilpo Järvinen
I've tried to pick the drivers such that these shouldn't collide with the ones Jiri's tx loop rewrite series is touching (unless he has something hidden beyond what has been on the list).
No, nothing more here.
thanks,
Signature · 1 line
js