From patchwork Wed May 22 11:50:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 17087 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F4061238FE for ; Wed, 22 May 2013 11:51:56 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id i3sf2362748vbh.4 for ; Wed, 22 May 2013 04:51:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=BNE4fqQ9YCejbN7TjNt+Fz5G4oKFc0ND0PT+rmp/LVA=; b=j+LekH2WOfgX8fM2Lbh6NBFNW/h1WKcm4dvXXe/udxGyKQW2fzupZ0YgKVYTqoozmx L4vBA2wMp6SmNv02G+sM5JX9iyHV5Y+syU+fntjCMxrAXRlbRsTw2xjFlPc8hgOuJthB Hibjx4fXwZlLpuUL7vOZ0moCo86lkEZWdh3ms3knGb9KGX14vlxqXK9vq0zN/WCAvJbR L0ARdVKRDHI2gspLiry8qXuKLN1VJcyycIxs1lsnkaBx7jRgueFNr1ZkWVthtxGDGfxB PdCworWiAByJ6Uu4rXPjKo6CXxSY+jW1rz87KCsxaPenV29VpPKMn5GOOsVxBLR7fqgl r6oQ== X-Received: by 10.224.200.202 with SMTP id ex10mr3710788qab.8.1369223464195; Wed, 22 May 2013 04:51:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.7 with SMTP id b7ls727115qel.12.gmail; Wed, 22 May 2013 04:51:04 -0700 (PDT) X-Received: by 10.220.111.133 with SMTP id s5mr2644217vcp.63.1369223464058; Wed, 22 May 2013 04:51:04 -0700 (PDT) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [2607:f8b0:400c:c01::230]) by mx.google.com with ESMTPS id zt2si2408090vdb.63.2013.05.22.04.51.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 04:51:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::230; Received: by mail-ve0-f176.google.com with SMTP id jz10so1346477veb.7 for ; Wed, 22 May 2013 04:51:03 -0700 (PDT) X-Received: by 10.52.34.114 with SMTP id y18mr2255565vdi.56.1369223463718; Wed, 22 May 2013 04:51:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp178521vcs; Wed, 22 May 2013 04:51:02 -0700 (PDT) X-Received: by 10.180.76.194 with SMTP id m2mr14168396wiw.4.1369223462519; Wed, 22 May 2013 04:51:02 -0700 (PDT) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [2a00:1450:400c:c05::22c]) by mx.google.com with ESMTPS id er5si4860070wic.56.2013.05.22.04.51.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 04:51:02 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22c is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=2a00:1450:400c:c05::22c; Received: by mail-wi0-f172.google.com with SMTP id ey16so3627747wid.17 for ; Wed, 22 May 2013 04:51:01 -0700 (PDT) X-Received: by 10.181.13.42 with SMTP id ev10mr32566607wid.1.1369223461793; Wed, 22 May 2013 04:51:01 -0700 (PDT) Received: from belegaer.uk.xensource.com. (firewall.ctxuk.citrix.com. [46.33.159.2]) by mx.google.com with ESMTPSA id eq15sm28382134wic.4.2013.05.22.04.50.59 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 22 May 2013 04:51:00 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: Stefano.Stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, Julien Grall Subject: [PATCH] drivers/exynos4210: Wait the end of last transfer before initializing the UART Date: Wed, 22 May 2013 12:50:56 +0100 Message-Id: <1369223456-3701-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmLnFtwq6gy7LsRKnMx7Ym/fvqZcGNijnHEvb0QswuEvc7twBftxCJdTzV38J/mOJQYDK58 X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::230 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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);