mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] driver/serial: stm-serial: fix flush
Date: Thu, 14 Mar 2013 18:31:53 +0100	[thread overview]
Message-ID: <1363282313-18176-3-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1363282313-18176-1-git-send-email-mkl@pengutronix.de>

Wait until fifo is empty, not until fifo is not full.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/serial/stm-serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index 3968892..e1276bd 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -34,6 +34,7 @@
 
 #define UARTDBGDR 0x00
 #define UARTDBGFR 0x18
+# define TXFE (1 << 7)
 # define TXFF (1 << 5)
 # define RXFE (1 << 4)
 #define UARTDBGIBRD 0x24
@@ -92,7 +93,7 @@ static void stm_serial_flush(struct console_device *cdev)
 	struct stm_priv *priv = container_of(cdev, struct stm_priv, cdev);
 
 	/* Wait for TX FIFO empty */
-	while (readl(priv->base + UARTDBGFR) & TXFF)
+	while (!(readl(priv->base + UARTDBGFR) & TXFE))
 		;
 }
 
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-03-14 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 17:31 [PATCH 1/2] serial: fix flush in auart and stm driver Marc Kleine-Budde
2013-03-14 17:31 ` [PATCH 1/2] driver/serial: auart: fix flush Marc Kleine-Budde
2013-03-14 17:31 ` Marc Kleine-Budde [this message]
2013-03-15  7:22 ` [PATCH 1/2] serial: fix flush in auart and stm driver Sascha Hauer

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=1363282313-18176-3-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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