summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Organov <sorganov@gmail.com>2019-08-28 14:37:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-04 06:43:55 -0400
commitc514a6f848b5bd991c908a395ba4e49a307a4ca7 (patch)
treed5b16e0026a051fa15ed352482237c32662356fb
parentd47bcb4a6cf0be5f3b390fe3fc12416034f86ae2 (diff)
serial: imx: use Tx ready rather than Tx empty irq
This should help to avoid unnecessary gaps in transmission while adding little overhead due to low default Tx threshold level (2 bytes). Signed-off-by: Sergey Organov <sorganov@gmail.com> Link: https://lore.kernel.org/r/1567017475-11919-6-git-send-email-sorganov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e89045a085fb..87c58f9f6390 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -439,7 +439,7 @@ static void imx_uart_stop_tx(struct uart_port *port)
439 return; 439 return;
440 440
441 ucr1 = imx_uart_readl(sport, UCR1); 441 ucr1 = imx_uart_readl(sport, UCR1);
442 imx_uart_writel(sport, ucr1 & ~UCR1_TXMPTYEN, UCR1); 442 imx_uart_writel(sport, ucr1 & ~UCR1_TRDYEN, UCR1);
443 443
444 /* in rs485 mode disable transmitter if shifter is empty */ 444 /* in rs485 mode disable transmitter if shifter is empty */
445 if (port->rs485.flags & SER_RS485_ENABLED && 445 if (port->rs485.flags & SER_RS485_ENABLED &&
@@ -517,7 +517,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport)
517 * and the TX IRQ is disabled. 517 * and the TX IRQ is disabled.
518 **/ 518 **/
519 ucr1 = imx_uart_readl(sport, UCR1); 519 ucr1 = imx_uart_readl(sport, UCR1);
520 ucr1 &= ~UCR1_TXMPTYEN; 520 ucr1 &= ~UCR1_TRDYEN;
521 if (sport->dma_is_txing) { 521 if (sport->dma_is_txing) {
522 ucr1 |= UCR1_TXDMAEN; 522 ucr1 |= UCR1_TXDMAEN;
523 imx_uart_writel(sport, ucr1, UCR1); 523 imx_uart_writel(sport, ucr1, UCR1);
@@ -679,7 +679,7 @@ static void imx_uart_start_tx(struct uart_port *port)
679 679
680 if (!sport->dma_is_enabled) { 680 if (!sport->dma_is_enabled) {
681 ucr1 = imx_uart_readl(sport, UCR1); 681 ucr1 = imx_uart_readl(sport, UCR1);
682 imx_uart_writel(sport, ucr1 | UCR1_TXMPTYEN, UCR1); 682 imx_uart_writel(sport, ucr1 | UCR1_TRDYEN, UCR1);
683 } 683 }
684 684
685 if (sport->dma_is_enabled) { 685 if (sport->dma_is_enabled) {
@@ -688,7 +688,7 @@ static void imx_uart_start_tx(struct uart_port *port)
688 * disable TX DMA to let TX interrupt to send X-char */ 688 * disable TX DMA to let TX interrupt to send X-char */
689 ucr1 = imx_uart_readl(sport, UCR1); 689 ucr1 = imx_uart_readl(sport, UCR1);
690 ucr1 &= ~UCR1_TXDMAEN; 690 ucr1 &= ~UCR1_TXDMAEN;
691 ucr1 |= UCR1_TXMPTYEN; 691 ucr1 |= UCR1_TRDYEN;
692 imx_uart_writel(sport, ucr1, UCR1); 692 imx_uart_writel(sport, ucr1, UCR1);
693 return; 693 return;
694 } 694 }
@@ -874,7 +874,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id)
874 usr1 &= ~USR1_RRDY; 874 usr1 &= ~USR1_RRDY;
875 if ((ucr2 & UCR2_ATEN) == 0) 875 if ((ucr2 & UCR2_ATEN) == 0)
876 usr1 &= ~USR1_AGTIM; 876 usr1 &= ~USR1_AGTIM;
877 if ((ucr1 & UCR1_TXMPTYEN) == 0) 877 if ((ucr1 & UCR1_TRDYEN) == 0)
878 usr1 &= ~USR1_TRDY; 878 usr1 &= ~USR1_TRDY;
879 if ((ucr4 & UCR4_TCEN) == 0) 879 if ((ucr4 & UCR4_TCEN) == 0)
880 usr2 &= ~USR2_TXDC; 880 usr2 &= ~USR2_TXDC;
@@ -1474,7 +1474,7 @@ static void imx_uart_shutdown(struct uart_port *port)
1474 1474
1475 spin_lock_irqsave(&sport->port.lock, flags); 1475 spin_lock_irqsave(&sport->port.lock, flags);
1476 ucr1 = imx_uart_readl(sport, UCR1); 1476 ucr1 = imx_uart_readl(sport, UCR1);
1477 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN | UCR1_RXDMAEN | UCR1_ATDMAEN); 1477 ucr1 &= ~(UCR1_TRDYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN | UCR1_RXDMAEN | UCR1_ATDMAEN);
1478 1478
1479 imx_uart_writel(sport, ucr1, UCR1); 1479 imx_uart_writel(sport, ucr1, UCR1);
1480 spin_unlock_irqrestore(&sport->port.lock, flags); 1480 spin_unlock_irqrestore(&sport->port.lock, flags);
@@ -1778,7 +1778,7 @@ static int imx_uart_poll_init(struct uart_port *port)
1778 ucr1 |= IMX1_UCR1_UARTCLKEN; 1778 ucr1 |= IMX1_UCR1_UARTCLKEN;
1779 1779
1780 ucr1 |= UCR1_UARTEN; 1780 ucr1 |= UCR1_UARTEN;
1781 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RTSDEN | UCR1_RRDYEN); 1781 ucr1 &= ~(UCR1_TRDYEN | UCR1_RTSDEN | UCR1_RRDYEN);
1782 1782
1783 ucr2 |= UCR2_RXEN; 1783 ucr2 |= UCR2_RXEN;
1784 ucr2 &= ~UCR2_ATEN; 1784 ucr2 &= ~UCR2_ATEN;
@@ -1938,7 +1938,7 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count)
1938 if (imx_uart_is_imx1(sport)) 1938 if (imx_uart_is_imx1(sport))
1939 ucr1 |= IMX1_UCR1_UARTCLKEN; 1939 ucr1 |= IMX1_UCR1_UARTCLKEN;
1940 ucr1 |= UCR1_UARTEN; 1940 ucr1 |= UCR1_UARTEN;
1941 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN); 1941 ucr1 &= ~(UCR1_TRDYEN | UCR1_RRDYEN | UCR1_RTSDEN);
1942 1942
1943 imx_uart_writel(sport, ucr1, UCR1); 1943 imx_uart_writel(sport, ucr1, UCR1);
1944 1944
@@ -2294,7 +2294,7 @@ static int imx_uart_probe(struct platform_device *pdev)
2294 /* Disable interrupts before requesting them */ 2294 /* Disable interrupts before requesting them */
2295 ucr1 = imx_uart_readl(sport, UCR1); 2295 ucr1 = imx_uart_readl(sport, UCR1);
2296 ucr1 &= ~(UCR1_ADEN | UCR1_TRDYEN | UCR1_IDEN | UCR1_RRDYEN | 2296 ucr1 &= ~(UCR1_ADEN | UCR1_TRDYEN | UCR1_IDEN | UCR1_RRDYEN |
2297 UCR1_TXMPTYEN | UCR1_RTSDEN); 2297 UCR1_TRDYEN | UCR1_RTSDEN);
2298 imx_uart_writel(sport, ucr1, UCR1); 2298 imx_uart_writel(sport, ucr1, UCR1);
2299 2299
2300 if (!imx_uart_is_imx1(sport) && sport->dte_mode) { 2300 if (!imx_uart_is_imx1(sport) && sport->dte_mode) {