devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nava kishore Manne <nava.manne@xilinx.com>
To: gregkh@linuxfoundation.org, robh+dt@kernel.org,
	mark.rutland@arm.com, jslaby@suse.com, michal.simek@xilinx.com,
	soren.brinkmann@xilinx.com, linux-serial@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, punnaia@xilinx.com
Cc: Nava kishore Manne <navam@xilinx.com>
Subject: [PATCH v2 3/3] tty: serial: xuartps: Wait for rx and tx reset done status
Date: Thu, 15 Sep 2016 14:45:31 +0530	[thread overview]
Message-ID: <1473930931-1034-3-git-send-email-navam@xilinx.com> (raw)
In-Reply-To: <1473930931-1034-1-git-send-email-navam@xilinx.com>

After issuing the reset, driver is not checking the rx and tx reset
done status. So, modified driver to wait for the reset done status.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
---
Changes for v2:
		-Added New patch

 drivers/tty/serial/xilinx_uartps.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 527526e..b69dea3 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -694,6 +694,10 @@ static void cdns_uart_set_termios(struct uart_port *port,
 	ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
 	writel(ctrl_reg, port->membase + CDNS_UART_CR);
 
+	while (readl(port->membase + CDNS_UART_CR) &
+		(CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+		cpu_relax();
+
 	/*
 	 * Clear the RX disable and TX disable bits and then set the TX enable
 	 * bit and RX enable bit to enable the transmitter and receiver.
@@ -797,6 +801,10 @@ static int cdns_uart_startup(struct uart_port *port)
 	writel(CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST,
 			port->membase + CDNS_UART_CR);
 
+	while (readl(port->membase + CDNS_UART_CR) &
+		(CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+		cpu_relax();
+
 	/*
 	 * Clear the RX disable bit and then set the RX enable bit to enable
 	 * the receiver.
-- 
2.1.2

      parent reply	other threads:[~2016-09-15  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15  9:15 [PATCH v2 1/3] serial: xuartps: Adds RXBS register support for zynqmp Nava kishore Manne
     [not found] ` <1473930931-1034-1-git-send-email-navam-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-09-15  9:15   ` [PATCH v2 2/3] devicetree: bindings: uart: Add new compatible string for ZynqMP Nava kishore Manne
     [not found]     ` <1473930931-1034-2-git-send-email-navam-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2016-09-22  9:45       ` Greg KH
2016-09-15  9:15 ` Nava kishore Manne [this message]

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=1473930931-1034-3-git-send-email-navam@xilinx.com \
    --to=nava.manne@xilinx.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michal.simek@xilinx.com \
    --cc=navam@xilinx.com \
    --cc=punnaia@xilinx.com \
    --cc=robh+dt@kernel.org \
    --cc=soren.brinkmann@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 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).