From patchwork Thu Feb 7 05:04:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2109331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 28F663FCD5 for ; Thu, 7 Feb 2013 05:07:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U3Jeh-0003R2-S8; Thu, 07 Feb 2013 05:04:15 +0000 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182] helo=ch1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1U3Jee-0003Qi-RG for linux-arm-kernel@lists.infradead.org; Thu, 07 Feb 2013 05:04:13 +0000 Received: from mail36-ch1-R.bigfish.com (10.43.68.252) by CH1EHSOBE001.bigfish.com (10.43.70.51) with Microsoft SMTP Server id 14.1.225.23; Thu, 7 Feb 2013 05:04:09 +0000 Received: from mail36-ch1 (localhost [127.0.0.1]) by mail36-ch1-R.bigfish.com (Postfix) with ESMTP id 0CD953E0214; Thu, 7 Feb 2013 05:04:09 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: -5 X-BigFish: VS-5(zzbb2dI98dI9371I1432I1447Izz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzzz2dh87h2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail36-ch1 (localhost.localdomain [127.0.0.1]) by mail36-ch1 (MessageSwitch) id 1360213446470982_15611; Thu, 7 Feb 2013 05:04:06 +0000 (UTC) Received: from CH1EHSMHS029.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.246]) by mail36-ch1.bigfish.com (Postfix) with ESMTP id 6FE522A00CE; Thu, 7 Feb 2013 05:04:06 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS029.bigfish.com (10.43.70.29) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 7 Feb 2013 05:04:06 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.318.3; Thu, 7 Feb 2013 05:04:05 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.181]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r17540aN018990; Wed, 6 Feb 2013 22:04:01 -0700 Date: Thu, 7 Feb 2013 13:04:36 +0800 From: Shawn Guo To: Stephen Warren Subject: Re: [PATCH v2 2/2] ARM: uncompress debug support for multiplatform build Message-ID: <20130207050434.GA7697@S2101-09.ap.freescale.net> References: <1358436119-30808-3-git-send-email-shawn.guo@linaro.org> <1358477120-19673-1-git-send-email-shawn.guo@linaro.org> <20130204160133.GH17786@n2100.arm.linux.org.uk> <20130206093236.GD17833@n2100.arm.linux.org.uk> <5112A933.4090108@wwwdotorg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5112A933.4090108@wwwdotorg.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130207_000412_927922_8FB8DDC2 X-CRM114-Status: GOOD ( 26.33 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.181.182 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: arm@kernel.org, Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, Feb 06, 2013 at 12:04:19PM -0700, Stephen Warren wrote: > On 02/06/2013 02:32 AM, Russell King - ARM Linux wrote: > > On Mon, Feb 04, 2013 at 04:01:33PM +0000, Russell King - ARM Linux wrote: > >> On Fri, Jan 18, 2013 at 10:45:20AM +0800, Shawn Guo wrote: > >>> Instead of giving zero support of uncompress debug for multiplatform > >>> build, the patch turns uncompress debug into one part of DEBUG_LL > >>> support. When DEBUG_LL is turned on for a particular platform, > >>> uncompress debug works too for that platform. > >>> > >>> It reuses the platform DEBUG_LL macros by creating a simple > >>> arch/arm/boot/compressed/debug.S with CONFIG_DEBUG_LL_INCLUDE > >>> included there, and implements a generic putc() using those macros. > >> > >> Ok, I've applied this on the previso that _no one_ in future whinges if > >> the debug infrastructure doesn't quite meet their expectation. The > >> debug infrastructure remains first and foremost that: a simple debug > >> infrastructure suitable for use in the early assembly and the like. > >> > >> That is its primary concern and trumps any requirements from consoles, > >> early printk, decompressor output, and the like. > > > > ... and now I've dropped the two patches because it causes build failures > > for all OMAP and PXA platforms. > > It also breaks tegra_defconfig. For reference, the (or perhaps just a) > reason here is that arch/arm/include/debug/tegra.S references symbol > tegra_uart_config, which is declared in arch/arm/mach-tegra/common.c, > which isn't part of the decompressor build. Tegra's uncompress.h doesn't > touch this symbol, hence avoids this problem. > Thanks for the info, Stephen. From what I see, the patch breaks omap, pxa and tegra build by different causes. --->8 Shawn === omap === AS arch/arm/boot/compressed/debug.o LD arch/arm/boot/compressed/vmlinux `.data' referenced in section `.text' of arch/arm/boot/compressed/debug.o: defined in discarded section `.data' of arch/arm/boot/compressed/debug.o make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 1 The following change moving the variables out of stack section seems fixing the failure, but I'm not quite sure if it works. 8<--- diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug index cfaed13..7b2877e 100644 --- a/arch/arm/mach-omap2/include/mach/debug-macro.S +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S @@ -17,11 +17,9 @@ #define UART_OFFSET(addr) ((addr) & 0x00ffffff) - .pushsection .data omap_uart_phys: .word 0 omap_uart_virt: .word 0 omap_uart_lsr: .word 0 - .popsection /* * Note that this code won't work if the bootloader passes --->8 === pxa/mmp === AS arch/arm/boot/compressed/debug.o arch/arm/boot/compressed/debug.S: Assembler messages: arch/arm/boot/compressed/debug.S:8: Error: garbage following instruction -- `ldr r2,=IOMEM(0xfe000000)' make[3]: *** [arch/arm/boot/compressed/debug.o] Error 1 This is fairly easy to fix with the following change. 8<--- diff --git a/arch/arm/boot/compressed/debug.S b/arch/arm/boot/compressed/debug.S index bdb0e25..6e8382d 100644 --- a/arch/arm/boot/compressed/debug.S +++ b/arch/arm/boot/compressed/debug.S @@ -1,4 +1,5 @@ #include +#include #include CONFIG_DEBUG_LL_INCLUDE --->8 === tegra === LD arch/arm/boot/compressed/vmlinux arch/arm/boot/compressed/debug.o: In function `putc': arch/arm/boot/compressed/debug.S:7: undefined reference to `tegra_uart_config' make[3]: *** [arch/arm/boot/compressed/vmlinux] Error 1 You have explained the cause clearly. > I'd guess OMAP is broken for similar reasons, since when I created the > tegra_uart_config symbol I was inspired by the OMAP DEBUG_LL code. > > Perhaps the patch can be re-cast to only affect multi-platform kernels, > and leave unconverted platforms using uncompress.h (at least, I assume > that must be the problem). Indeed. The arch/arm/boot/compressed/debug.S shouldn't be part of traditional build but only multiplatform. Let's force that with the change below. 8<--- diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index c9865f6..13bdd10 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -24,9 +24,11 @@ endif AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) HEAD = head.o OBJS += misc.o decompress.o +ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y) ifeq ($(CONFIG_DEBUG_LL),y) OBJS += debug.o endif +endif FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c # string library code (-Os is enforced to keep it much smaller)