From patchwork Thu Jul 21 13:48:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 994902 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6LDmQRG011049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Jul 2011 13:48:47 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qjtbw-0004OZ-11; Thu, 21 Jul 2011 13:48:20 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qjtbv-000493-KJ; Thu, 21 Jul 2011 13:48:19 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qjtbr-00048k-3h for linux-arm-kernel@lists.infradead.org; Thu, 21 Jul 2011 13:48:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=H4jybpWjz541jSmnd75lNkE8FiEX6msksFVcUIH9DTM=; b=mKRdPOF0EM+nwgKWocl/9drLWtwyN0+paIdSU4xwWEgSpsh6CipELzeWClX0uPWe4xlm18s+57TGUs7tgVSZOVQOs5Df3X/INtZQgl17Wil8sePuA6HxtuWZaUXhfDPmw0Vvwy3tiDTuIJZNF1WczQnIfqy8r2qTF8EpbmdcILI=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1Qjtbi-0003qx-Mb; Thu, 21 Jul 2011 14:48:07 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.72) (envelope-from ) id 1Qjtbh-0001gX-9r; Thu, 21 Jul 2011 14:48:05 +0100 Date: Thu, 21 Jul 2011 14:48:04 +0100 From: Russell King - ARM Linux To: Dave Martin Subject: Re: linux-next regression on ARM926 Message-ID: <20110721134804.GO26574@n2100.arm.linux.org.uk> References: <20110718112757.GV23270@n2100.arm.linux.org.uk> <20110719110904.GJ26574@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110721_094815_873441_581CDCC4 X-CRM114-Status: GOOD ( 37.72 ) X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 21 Jul 2011 13:48:47 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter2.kernel.org id p6LDmQRG011049 On Wed, Jul 20, 2011 at 09:35:03AM +0100, Dave Martin wrote: > On Tue, Jul 19, 2011 at 12:09 PM, Russell King - ARM Linux > wrote: > > On Tue, Jul 19, 2011 at 11:27:38AM +0100, Dave Martin wrote: > >> On Mon, Jul 18, 2011 at 12:27 PM, Russell King - ARM Linux > >> wrote: > >> > On Mon, Jul 18, 2011 at 01:02:01PM +0200, Linus Walleij wrote: > >> >> Hi Dave, > >> >> > >> >> do you have any hints on how to resolve this build error in the -next > >> >> tree: > >> >> > >> >>   LD      .tmp_vmlinux1 > >> >> arch/arm/mm/built-in.o:(.init.data+0xe0): undefined reference to > >> >> `cpu_arm926_do_suspend' > >> >> arch/arm/mm/built-in.o:(.init.data+0xe4): undefined reference to > >> >> `cpu_arm926_do_resume' > >> >> make[2]: *** [.tmp_vmlinux1] Error 1 > >> >> make[1]: *** [sub-make] Error 2 > >> >> make[1]: Leaving directory `/home/linus/linux-next' > >> >> make: *** [build] Error 2 > >> >> > >> >> This is while building the U300, I can't really tell if the error is on my > >> >> (U300) side or in the recent patches to the proc_arm926 stuff? > >> >> It seems all ARM926 SoCs were affected. > >> > > >> > Hmm. > >> > > >> > That happens because without CONFIG_PM_SLEEP, we do this: > >> > > >> > #define cpu_arm926_do_suspend   0 > >> > #define cpu_arm926_do_resume    0 > >> > > >> > whereas the macro assembler does this: > >> > > >> >        .word   cpu_\name\()_do_suspend > >> >        .word   cpu_\name\()_do_resume > >> > > >> > and this means that neither the preprocessor nor the assembler can tie > >> > these two together. > >> > > >> > One solution would be to put an #ifdef CONFIG_PM_SLEEP around that in > >> > mm/proc-macros.S to select .word 0 instead, and get rid of the #else > >> > in the individual proc-*.S files - something like this (untested): > >> > > >> > diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S > >> > index b2f9bde..2bbcf05 100644 > >> > --- a/arch/arm/mm/proc-arm926.S > >> > +++ b/arch/arm/mm/proc-arm926.S > >> > @@ -421,9 +421,6 @@ ENTRY(cpu_arm926_do_resume) > >> >                     PMD_SECT_CACHEABLE | PMD_BIT4 | PMD_SECT_AP_WRITE > >> >        b       cpu_resume_mmu > >> >  ENDPROC(cpu_arm926_do_resume) > >> > -#else > >> > -#define cpu_arm926_do_suspend  0 > >> > -#define cpu_arm926_do_resume   0 > >> >  #endif > >> > > >> >        __CPUINIT > >> > diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S > >> > index 4ae9b44..307a4de 100644 > >> > --- a/arch/arm/mm/proc-macros.S > >> > +++ b/arch/arm/mm/proc-macros.S > >> > @@ -276,8 +276,13 @@ ENTRY(\name\()_processor_functions) > >> > > >> >        .if \suspend > >> >        .word   cpu_\name\()_suspend_size > >> > +#ifdef CONFIG_PM_SLEEP > >> >        .word   cpu_\name\()_do_suspend > >> >        .word   cpu_\name\()_do_resume > >> > +#else > >> > +       .word   0 > >> > +       .word   0 > >> > +#endif > >> >        .else > >> >        .word   0 > >> >        .word   0 > >> > > >> > > >> > >> The intended meaning of "suspend=1" for define_processor_functions was > >> "this cpu can do suspend" -- but this makes sense only if > >> CONFIG_PM_SLEEP is enabled.  Where processors define their suspend > >> functions unconditionally, that isn't a problem.  But processors > >> shouldn't be required (or even encouraged) to define those functions > >> if the kernel doesn't have suspend support at all. > >> > >> So the above fix looks entirely sensible to me. > >> > >> I'm offline for the next day or two, but I trust Linus' test -- so if you like: > >> > >> Acked-by: Dave Martin > > > > We need to fix up the other proc-*.S files to remove the #else clause too, > > so the above patch was just supposed to be an example... > > > > Hmmm, I'll take a closer look at the implications ... but > unfortunately I'm not going to be able to do much until Thursday. I've just applied such an extended patch covering the other proc-*.S files - with your ack: 8<-------- From: Russell King - ARM Linux Subject: [PATCH] ARM: Fix build errors caused by adding generic macros Commit 66a625a (ARM: mm: proc-macros: Add generic proc/cache/tlb struct definition macros) introduced build errors when PM_SLEEP is not enabled. The per-CPU do_suspend/do_resume functions are defined via the preprocessor to constant 0. However, the macros which use these were converted to assembly, resulting in undefined references to these functions. Fix that by moving the ! ifdef section into proc-macros.S and deleting it from all effected proc-*.S files. Acked-by: Dave Martin Signed-off-by: Russell King Acked-by: Linus Walleij --- arch/arm/mm/proc-arm920.S | 3 --- arch/arm/mm/proc-arm926.S | 3 --- arch/arm/mm/proc-macros.S | 5 +++++ arch/arm/mm/proc-sa1100.S | 3 --- arch/arm/mm/proc-v7.S | 3 --- arch/arm/mm/proc-xsc3.S | 3 --- arch/arm/mm/proc-xscale.S | 3 --- 7 files changed, 5 insertions(+), 18 deletions(-) diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index 0dea376..92bd102 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S @@ -406,9 +406,6 @@ ENTRY(cpu_arm920_do_resume) PMD_SECT_CACHEABLE | PMD_BIT4 | PMD_SECT_AP_WRITE b cpu_resume_mmu ENDPROC(cpu_arm920_do_resume) -#else -#define cpu_arm920_do_suspend 0 -#define cpu_arm920_do_resume 0 #endif __CPUINIT diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S index b2f9bde..2bbcf05 100644 --- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S @@ -421,9 +421,6 @@ ENTRY(cpu_arm926_do_resume) PMD_SECT_CACHEABLE | PMD_BIT4 | PMD_SECT_AP_WRITE b cpu_resume_mmu ENDPROC(cpu_arm926_do_resume) -#else -#define cpu_arm926_do_suspend 0 -#define cpu_arm926_do_resume 0 #endif __CPUINIT diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index 4ae9b44..307a4de 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -276,8 +276,13 @@ ENTRY(\name\()_processor_functions) .if \suspend .word cpu_\name\()_suspend_size +#ifdef CONFIG_PM_SLEEP .word cpu_\name\()_do_suspend .word cpu_\name\()_do_resume +#else + .word 0 + .word 0 +#endif .else .word 0 .word 0 diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S index c7e08ca..e715878 100644 --- a/arch/arm/mm/proc-sa1100.S +++ b/arch/arm/mm/proc-sa1100.S @@ -200,9 +200,6 @@ ENTRY(cpu_sa1100_do_resume) PMD_SECT_CACHEABLE | PMD_SECT_AP_WRITE b cpu_resume_mmu ENDPROC(cpu_sa1100_do_resume) -#else -#define cpu_sa1100_do_suspend 0 -#define cpu_sa1100_do_resume 0 #endif __CPUINIT diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 54d1a63..a30e785 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -263,9 +263,6 @@ ENDPROC(cpu_v7_do_resume) cpu_resume_l1_flags: ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_SMP) ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_UP) -#else -#define cpu_v7_do_suspend 0 -#define cpu_v7_do_resume 0 #endif __CPUINIT diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index 1508f9b..64f1fc7 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S @@ -445,9 +445,6 @@ ENTRY(cpu_xsc3_do_resume) ldr r3, =0x542e @ section flags b cpu_resume_mmu ENDPROC(cpu_xsc3_do_resume) -#else -#define cpu_xsc3_do_suspend 0 -#define cpu_xsc3_do_resume 0 #endif __CPUINIT diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S index 76a8046..fbc06e5 100644 --- a/arch/arm/mm/proc-xscale.S +++ b/arch/arm/mm/proc-xscale.S @@ -554,9 +554,6 @@ ENTRY(cpu_xscale_do_resume) PMD_SECT_CACHEABLE | PMD_SECT_AP_WRITE b cpu_resume_mmu ENDPROC(cpu_xscale_do_resume) -#else -#define cpu_xscale_do_suspend 0 -#define cpu_xscale_do_resume 0 #endif __CPUINIT