From patchwork Tue Oct 31 17:06:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 10034963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7958602B9 for ; Tue, 31 Oct 2017 17:07:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2E38285D8 for ; Tue, 31 Oct 2017 17:07:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9795B28AFA; Tue, 31 Oct 2017 17:07:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 11EDF285D8 for ; Tue, 31 Oct 2017 17:07:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4WKxq2vgTG2nxLuG+PNuz4Cz5d6IfduVTxXj6a0HbQE=; b=n5jOl+C1w6JXOh fxhKjPaGIfArfs7M4cAT6KDzijjyZV7nJCztuHtHdtkU/oihoLSXnVoO6W3PjO4X7aYzG0duRvgpQ gtpg7bZCxtj/Kp/aZxrFLmKB/+9Dk/i/YaM8uuIlhxmm9vmgLreXH7KqvCMbVGn6W6xx24yi715O5 fISGucBj76KlxAAwAIyoZi0a7ndHqjM4fuz9k06vxM76NKO7t6bQELOeF85OBZiqNKZuD4FdaksYP byTcYT0oBr95RGdYm6umgUzW0bPCSfEv/pKpZ/6TxYgXPCb58sMf4AwYlE540fpueIj3ySBzS4Ecg NnuAOQ0T3iHe5iYAzVFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e9a0F-0002qA-BJ; Tue, 31 Oct 2017 17:07:03 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9a09-0002mg-Nl for linux-arm-kernel@lists.infradead.org; Tue, 31 Oct 2017 17:07:00 +0000 Received: by mail-qt0-x242.google.com with SMTP id 8so21640172qtv.1 for ; Tue, 31 Oct 2017 10:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=692Y93+APitQeQracLtFHNNDaYUC3AnS/JeYFcOUn84=; b=QynEuBulCsNoQDb4inaGrdihzerg21Vq6Chct2HIUvmN2V2uwusrO75LlyYwmLIcok DuCCWfv7+dHI5JCSdqppzdfL7XavE27KApQaZ/c8KaO6ar38DL8fr46jgXHyFRvbWSL1 RU5v/vvMr7jp37JZJAirU+bKuWLiAdV8Flpgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=692Y93+APitQeQracLtFHNNDaYUC3AnS/JeYFcOUn84=; b=oRmcbW3kkTXzZ4n+pjhLsk7rXXPbz9PvXO/6YQGWU3Q1C3wPwxVH4y+oyfDfGEibnN 8f5wQS2pMHlx7GaIRZk3Bni4DtDF2zs+yNZmVwbvt0UJjRyxUSTq13uxa66dsa/eky5z QsBs5V4AUIbYMvDsrUknzZQB3RosT3cVApx0qhI0hCX8r3oWWO9K4AHZvNUAddenVoHT MD6UjMmOz5Y5PbBrDOubZ2d8qdTO09xUzKprx4QTdWAxs+w+hX2ubnP82ZdIQreji/TE 59j72vhHzqsv57BEE72/A1/i0KjU3tlp8mMQzagjCouXRoVxXCT2t6gHv56NjqhHBjQi 8sgw== X-Gm-Message-State: AMCzsaX7lf6GRPXWnIDUzDQ/30Nf7qGJ1xxbmqBDep2SWiijB7kNrVSC 4Nd28CtuaqirWT/V5fwqBEcTQpGUdYM= X-Google-Smtp-Source: ABhQp+Qd26JXpwf01f8O4HiuOnaEcTAEnxNOJy8ft8Zxb9rVeJys7EhtZi2T6CMSdMby1zC7RaITjQ== X-Received: by 10.200.26.90 with SMTP id q26mr4219363qtk.109.1509469596422; Tue, 31 Oct 2017 10:06:36 -0700 (PDT) Received: from xanadu.home (modemcable045.234-175-137.mc.videotron.ca. [137.175.234.45]) by smtp.gmail.com with ESMTPSA id g7sm1134760qkf.72.2017.10.31.10.06.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 10:06:35 -0700 (PDT) Date: Tue, 31 Oct 2017 13:06:35 -0400 (EDT) From: Nicolas Pitre To: Robin Murphy , Chris Brandt Subject: Re: [PATCH 3/3] ARM: early_printk: use printascii() rather than printch() In-Reply-To: <80bc8c16-321a-43ea-6cbb-257dbeee485b@arm.com> Message-ID: References: <20171002020618.23924-1-nicolas.pitre@linaro.org> <20171002020618.23924-4-nicolas.pitre@linaro.org> <80bc8c16-321a-43ea-6cbb-257dbeee485b@arm.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171031_100657_924604_796B35D4 X-CRM114-Status: GOOD ( 20.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 31 Oct 2017, Robin Murphy wrote: > On 31/10/17 16:22, Nicolas Pitre wrote: > > On Tue, 31 Oct 2017, Chris Brandt wrote: > > > >> On Sunday, October 01, 2017 1, Nicolas Pitre wrote: > >>> With printch() the console messages are sent out one character at a time > >>> which is agonizingly slow especially with semihosting as the whole trap > >>> intercept, remote byte access, and system resume danse is performed for > >>> every single character across a relatively slow remote debug connection. > >>> Let's use printascii() to send a whole string at once. This is also going > >>> to be more efficient, albeit to a quite lesser extent, with serial ports > >>> as well. > >>> > >>> Signed-off-by: Nicolas Pitre > >>> --- > >>> arch/arm/kernel/early_printk.c | 16 ++++++++++------ > >>> 1 file changed, 10 insertions(+), 6 deletions(-) > >> > >> Now that this patch has hit -next, I'm noticing an issue with it. > >> > >> There are no carriage returns, just line feeds, which makes for a very > >> ugly display. > > > > Hmmm.... > > > > If you look at printascii in arch/arm/kernel/debug.S you'll find the > > following code: > > > > 1: waituart r2, r3 > > senduart r1, r3 > > busyuart r2, r3 > > teq r1, #'\n' > > moveq r1, #'\r' > > beq 1b > > > > Why is that not working for you? > > By inspection, the removed early_write() code inserted the '\r' before > the '\n' in the usual fashion; the printascii() code above ends up doing > the reverse, and I can imagine the atypical "\n\r" sequence probably > confuses some terminals trying to be clever with line ending detection. That's easy to veryfy with this patch: @Chris: does the above fix your display issue? Nicolas diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index ea9646cc2a..40023a4871 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S @@ -79,18 +79,21 @@ hexbuf: .space 16 ENTRY(printascii) addruart_current r3, r1, r2 - b 2f -1: waituart r2, r3 - senduart r1, r3 - busyuart r2, r3 - teq r1, #'\n' - moveq r1, #'\r' - beq 1b -2: teq r0, #0 +1: teq r0, #0 ldrneb r1, [r0], #1 teqne r1, #0 - bne 1b - ret lr + reteq lr + teq r1, #'\n' + bne 2f + mov r1, '\r' + waituart r2, r3 + senduart r1, r3 + busyuart r2, r3 + mov r1, '\n' +2: waituart r2, r3 + senduart r1, r3 + busyuart r2, r3 + b 1b ENDPROC(printascii) ENTRY(printch)