All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: linux-serial@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, gregkh@linuxfoundation.org,
	michal.simek@xilinx.com,
	Raviteja Narayanam <raviteja.narayanam@xilinx.com>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Subject: [PATCH v4 1/2] serial: uartps: Remove unconditional wait inside set_termios
Date: Thu, 19 Mar 2020 15:14:50 +0530	[thread overview]
Message-ID: <536e190dd5bbb474007a67e6323c048288942a28.1584610774.git.shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <cover.1584610774.git.shubhrajyoti.datta@xilinx.com>

From: Raviteja Narayanam <raviteja.narayanam@xilinx.com>

set_termios function should not wait for the transmit FIFO empty
(CDNS_UART_SR_TXEMPTY) unconditionally. The tty layer takes care
of it based on the parameter passed (TCSANOW/TCSADRAIN/TCSAFLUSH).

Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/tty/serial/xilinx_uartps.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 30a1425..662b8ab 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -706,20 +706,8 @@ static void cdns_uart_set_termios(struct uart_port *port,
 	u32 cval = 0;
 	unsigned int baud, minbaud, maxbaud;
 	unsigned long flags;
-	unsigned int ctrl_reg, mode_reg, val;
-	int err;
-
-	/* Wait for the transmit FIFO to empty before making changes */
-	if (!(readl(port->membase + CDNS_UART_CR) &
-				CDNS_UART_CR_TX_DIS)) {
-		err = readl_poll_timeout(port->membase + CDNS_UART_SR,
-					 val, (val & CDNS_UART_SR_TXEMPTY),
-					 1000, TX_TIMEOUT);
-		if (err) {
-			dev_err(port->dev, "timed out waiting for tx empty");
-			return;
-		}
-	}
+	unsigned int ctrl_reg, mode_reg;
+
 	spin_lock_irqsave(&port->lock, flags);
 
 	/* Disable the TX and RX to set baud rate */
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: linux-serial@vger.kernel.org
Cc: Raviteja Narayanam <raviteja.narayanam@xilinx.com>,
	gregkh@linuxfoundation.org,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	michal.simek@xilinx.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] serial: uartps: Remove unconditional wait inside set_termios
Date: Thu, 19 Mar 2020 15:14:50 +0530	[thread overview]
Message-ID: <536e190dd5bbb474007a67e6323c048288942a28.1584610774.git.shubhrajyoti.datta@xilinx.com> (raw)
In-Reply-To: <cover.1584610774.git.shubhrajyoti.datta@xilinx.com>

From: Raviteja Narayanam <raviteja.narayanam@xilinx.com>

set_termios function should not wait for the transmit FIFO empty
(CDNS_UART_SR_TXEMPTY) unconditionally. The tty layer takes care
of it based on the parameter passed (TCSANOW/TCSADRAIN/TCSAFLUSH).

Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
---
 drivers/tty/serial/xilinx_uartps.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 30a1425..662b8ab 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -706,20 +706,8 @@ static void cdns_uart_set_termios(struct uart_port *port,
 	u32 cval = 0;
 	unsigned int baud, minbaud, maxbaud;
 	unsigned long flags;
-	unsigned int ctrl_reg, mode_reg, val;
-	int err;
-
-	/* Wait for the transmit FIFO to empty before making changes */
-	if (!(readl(port->membase + CDNS_UART_CR) &
-				CDNS_UART_CR_TX_DIS)) {
-		err = readl_poll_timeout(port->membase + CDNS_UART_SR,
-					 val, (val & CDNS_UART_SR_TXEMPTY),
-					 1000, TX_TIMEOUT);
-		if (err) {
-			dev_err(port->dev, "timed out waiting for tx empty");
-			return;
-		}
-	}
+	unsigned int ctrl_reg, mode_reg;
+
 	spin_lock_irqsave(&port->lock, flags);
 
 	/* Disable the TX and RX to set baud rate */
-- 
2.1.1


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

  reply	other threads:[~2020-03-19  9:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19  9:44 [PATCH v4 0/2] serial: uartps: Add TACTIVE check Shubhrajyoti Datta
2020-03-19  9:44 ` Shubhrajyoti Datta
2020-03-19  9:44 ` Shubhrajyoti Datta [this message]
2020-03-19  9:44   ` [PATCH v4 1/2] serial: uartps: Remove unconditional wait inside set_termios Shubhrajyoti Datta
2020-03-19  9:44 ` [PATCH v4 2/2] serial: uartps: Add TACTIVE check in cdns_uart_tx_empty function Shubhrajyoti Datta
2020-03-19  9:44   ` Shubhrajyoti Datta
2020-03-21 10:07   ` Maarten Brock
2020-03-21 10:07     ` Maarten Brock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=536e190dd5bbb474007a67e6323c048288942a28.1584610774.git.shubhrajyoti.datta@xilinx.com \
    --to=shubhrajyoti.datta@xilinx.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=raviteja.narayanam@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.