From patchwork Tue Oct 29 15:28:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 286870 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7B8252C0345 for ; Wed, 30 Oct 2013 02:29:34 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbBEP-0004gd-Mt; Tue, 29 Oct 2013 15:29:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbBEN-0003wM-A9; Tue, 29 Oct 2013 15:29:19 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbBEK-0003tf-DS for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2013 15:29:17 +0000 Received: from ukl by metis.ext.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1VbBDu-0007RB-B6; Tue, 29 Oct 2013 16:28:50 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-arm-kernel@lists.infradead.org Date: Tue, 29 Oct 2013 16:28:39 +0100 Message-Id: <1383060519-14868-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.8.4.rc3 MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ukl@pengutronix.de X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on metis.extern.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=4.0 tests=BAYES_00,NO_RELAYS shortcircuit=no autolearn=ham version=3.3.2 Subject: [PATCH] [RFC] ARM: debug: only wait for an idle uart after all chars are sent X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131029_112916_770536_B25D93B7 X-CRM114-Status: GOOD ( 16.12 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Instead of waiting after every single character that the fifo and shifter become empty only wait after the whole string. Without this optimization the fifo isn't used at all for more than a single character. The added benefit is that debug output speed is improved. Signed-off-by: Uwe Kleine-König --- Hello, I didn't do any benchmarks with this patch but noticed this optimization when I copied the printch/printascii code for the bootloader on efm32. Obviously it depends on waituart to reliably signal if there is space available in the fifo while without this patch debug output works fine if only busyuart is functional. So this breaks at least arch/arm/include/debug/imx.S and arch/arm/include/debug/8250.S . Looking at the 8250 code I wonder if I got the semantics of waituart right. I thought it's about waiting until there is space available in the fifo but arch/arm/include/debug/8250.S suggests it's about hand shaking? (In that case my patch would be wrong.) Best regards Uwe --- arch/arm/kernel/debug.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index e18cb30..17156ee 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S @@ -83,7 +83,6 @@ ENTRY(printascii) b 2f 1: waituart r2, r3 senduart r1, r3 - busyuart r2, r3 teq r1, #'\n' moveq r1, #'\r' beq 1b @@ -91,6 +90,7 @@ ENTRY(printascii) ldrneb r1, [r0], #1 teqne r1, #0 bne 1b + busyuart r2, r3 mov pc, lr ENDPROC(printascii)