xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
	Julien Grall <julien.grall@linaro.org>,
	Stefano.Stabellini@eu.citrix.com
Subject: [PATCH] drivers/exynos4210: Wait the end of last transfer before initializing the UART
Date: Wed, 22 May 2013 12:50:56 +0100	[thread overview]
Message-ID: <1369223456-3701-1-git-send-email-julien.grall@linaro.org> (raw)

When early printk is enabled by the user, it's possible to loose the last
characters if the UART is initialized without waiting that the last transfer
was completed.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/drivers/char/exynos4210-uart.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index f7971da..13758d4 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -104,6 +104,12 @@ static void __init exynos4210_uart_init_preirq(struct serial_port *port)
     unsigned int divisor;
     uint32_t ulcon;
 
+#ifdef EARLY_PRINTK
+    /* Flush the UART */
+    while ( !(exynos4210_read(uart, UTRSTAT) &  UTRSTAT_TX_EMPTY) )
+        cpu_relax();
+#endif
+
     /* reset, TX/RX disables */
     exynos4210_write(uart, UCON, 0);
 
-- 
1.7.10.4

             reply	other threads:[~2013-05-22 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 11:50 Julien Grall [this message]
2013-05-23 11:58 ` [PATCH] drivers/exynos4210: Wait the end of last transfer before initializing the UART Ian Campbell
2013-05-23 12:01   ` Ian Campbell
2013-05-23 13:40     ` Julien Grall

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=1369223456-3701-1-git-send-email-julien.grall@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=patches@linaro.org \
    --cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).