From patchwork Tue Oct 31 17:48:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 10035053 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 4BAEB602B9 for ; Tue, 31 Oct 2017 17:48:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CDE328A9C for ; Tue, 31 Oct 2017 17:48:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20552286F1; Tue, 31 Oct 2017 17:48:30 +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 9145A286F1 for ; Tue, 31 Oct 2017 17:48:29 +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=C47OjT2qW3nsrB0my4AiB+RHKC5pRbQxPk1VKfj+xaU=; b=tJ8XINqWDBpLaa 8NSaUUuOhDI6ZMk45jmr3lugQna20gKd07tlWiyd9YxN5q6aqVrM8/wZJPch6pB0rqs74Ml6aFDN6 8V5f/pFIRfsTuanL7wnzKtRrLbAPk9o+uOuOPteQXc9/aBW22qDiyF7B9wP5tebudOl0YzomUVfhZ L0r216HIDyqZaCupUTRCxQA/ZWuVi1aSu2rP4ZzMQTrknnoWsugAagqiKiJMq0L4EMcgWS6CQ2Vul dNQ0M41VOnPe9ES+7V8gLHiAyPdr/NfQG9VDTNtHYk1v+T1ik0ypMoBe3ZYoCudvo7iZFOG05pVze yq8EBEXSfC66qk2yas9w==; 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 1e9aeK-00082r-S9; Tue, 31 Oct 2017 17:48:28 +0000 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9aeG-0007yp-Dx for linux-arm-kernel@lists.infradead.org; Tue, 31 Oct 2017 17:48:26 +0000 Received: by mail-qt0-x244.google.com with SMTP id 8so21808122qtv.1 for ; Tue, 31 Oct 2017 10:48:04 -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=2PnZjB3gvXIx+dnTOiZPZlaXG/q4wcSoWhhiU8KGsQ8=; b=OpAoKmk5k6CrNNd0GQ+15PjEc2xLW4du1NFIVgEnPh7Px54+/1/M/WnWDPeKdWWtq2 bgiZjqHiYzzZMLXPTA2q/HPo9ERHbMMx6bTmzX87MB7nCJ6YopuNsuZgaKC2b2nFCdKe YIxwIKA8kRlFMIj0T31YvUJi0nyT+fBPxKNEU= 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=2PnZjB3gvXIx+dnTOiZPZlaXG/q4wcSoWhhiU8KGsQ8=; b=Dbg/pOgEhg6FPR7720s3R8ZLz/Izd0ZhM3giDGg1Z7bT8YJaYeP4BggnR9buQ01Rhe jYWTm4ZZKY34gduZdc8hL1HGlBRD8Aa8IoZoDczSx6g/ivvFF7lLMxCaS5NVVhrQA77g KwtfV3oabWljmkmZ0vNAyaBj651uRn4tiiHRFAkesWdgbpyelW1azEa3OZ410FoTHTIt VqhP1sHrINjbMppiQYYEFbWSR8ilHHC1hvpTC8q/0BXrFFL2tDoaU+3gioREUis3sdsd u6j9hzcB7x/10Ninl5pI3TbCSrWNbKr2XXTCUFJ0C9Zmw6V1xS9AmYmrFo8Ab/K0usnb liLQ== X-Gm-Message-State: AMCzsaXqTbkoYIC5s/FtfJwDGFKVKKRKwL1yoUplTYguRXH6VfH5NCwG D2NRD4s/4w5J4bb4O86GlpfmhA== X-Google-Smtp-Source: ABhQp+Roctue2SCJTjyDjUAjwNNrOI9i1NfaJe0zhxESWdetgB7RTLvn/Hbftgg4fWE38nhSqFAIVQ== X-Received: by 10.200.1.72 with SMTP id f8mr3879289qtg.146.1509472083317; Tue, 31 Oct 2017 10:48:03 -0700 (PDT) Received: from xanadu.home (modemcable045.234-175-137.mc.videotron.ca. [137.175.234.45]) by smtp.gmail.com with ESMTPSA id i37sm1241586qte.56.2017.10.31.10.48.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 10:48:02 -0700 (PDT) Date: Tue, 31 Oct 2017 13:48:01 -0400 (EDT) From: Nicolas Pitre To: Russell King - ARM Linux Subject: Re: [PATCH 3/3] ARM: early_printk: use printascii() rather than printch() In-Reply-To: <20171031171629.GI9463@n2100.armlinux.org.uk> Message-ID: References: <20171002020618.23924-1-nicolas.pitre@linaro.org> <20171002020618.23924-4-nicolas.pitre@linaro.org> <80bc8c16-321a-43ea-6cbb-257dbeee485b@arm.com> <20171031171629.GI9463@n2100.armlinux.org.uk> 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_104824_554605_F463A175 X-CRM114-Status: GOOD ( 17.00 ) 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: Chris Brandt , Robin Murphy , "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, Russell King - ARM Linux wrote: > On Tue, Oct 31, 2017 at 01:06:35PM -0400, Nicolas Pitre wrote: > > That's easy to veryfy with this patch: > > Unfortunately not that easy, this patch breaks printch. Right, missed that. New patch below: > > > 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 > > > > The new code is: > > > ENTRY(printascii) > > addruart_current r3, r1, r2 > > +1: teq r0, #0 > > ldrneb r1, [r0], #1 > > teqne r1, #0 > > + 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) > > and printch jumps to the 1: label with r0 = 0 and r1 = character. Your > change has the effect that the "reteq" will always be taken when called > by printch. > > -- > RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up > According to speedtest.net: 8.21Mbps down 510kbps up > diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S index ea9646cc2a..0d1cef4b6e 100644 --- a/arch/arm/kernel/debug.S +++ b/arch/arm/kernel/debug.S @@ -79,25 +79,28 @@ 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) addruart_current r3, r1, r2 mov r1, r0 mov r0, #0 - b 1b + b 2b ENDPROC(printch) #ifdef CONFIG_MMU