From patchwork Fri May 31 09:45:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas KANDAGATLA X-Patchwork-Id: 2641401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 77061DFB79 for ; Fri, 31 May 2013 09:56:07 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiM32-0004F7-Hk; Fri, 31 May 2013 09:55:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiM2h-0004ur-Fu; Fri, 31 May 2013 09:54:39 +0000 Received: from eu1sys200aog116.obsmtp.com ([207.126.144.141]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiM2U-0004rp-4B for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 09:54:28 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUahzNhH//D+E6Td61ZWieEfqcqv03Txd@postini.com; Fri, 31 May 2013 09:54:25 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5823A19D; Fri, 31 May 2013 09:53:57 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C78EF4BBA; Fri, 31 May 2013 09:53:39 +0000 (GMT) Received: from localhost (king.bri.st.com [10.65.51.59]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BEM69616 (AUTH srinivak); Fri, 31 May 2013 11:53:56 +0200 From: Srinivas KANDAGATLA To: Barry Song Subject: [PATCH v1 2/2] ARM:prima2:move postcore_initcalls to init_machine. Date: Fri, 31 May 2013 10:45:17 +0100 Message-Id: <1369993517-24735-1-git-send-email-srinivas.kandagatla@st.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1369993439-24216-1-git-send-email-srinivas.kandagatla@st.com> References: <1369993439-24216-1-git-send-email-srinivas.kandagatla@st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_055426_428867_8595FDE7 X-CRM114-Status: GOOD ( 17.94 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.141 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Srinivas Kandagatla X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Srinivas Kandagatla This patch moves all postcore_initcalls to very first calls in init_machine. This should achieve the same sequencing as done via postcore_initcalls. Without this patch a multi_v7 kernel panics if we boot it on any non prima2 parts with below log: Kernel panic - not syncing: unable to find compatible pwrc node in dtb CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc3-00536-ge2f1bc1 #63 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) [] (show_stack+0x10/0x14) from [] (panic+0x90/0x1e4) [] (panic+0x90/0x1e4) from [] (sirfsoc_of_pwrc_init+0x24/0x58) [] (sirfsoc_of_pwrc_init+0x24/0x58) from [] (do_one_initcall+0x90/0x150) [] (do_one_initcall+0x90/0x150) from [] (kernel_init_freeable+0xfc/0x1c4) [] (kernel_init_freeable+0xfc/0x1c4) from [] (kernel_init+0x8/0xe4) [] (kernel_init+0x8/0xe4) from [] (ret_from_fork+0x14/0x3c) CPU1: stopping CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.10.0-rc3-00536-ge2f1bc1 #63 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) [] (show_stack+0x10/0x14) from [] (handle_IPI+0xf8/0x12c) [] (handle_IPI+0xf8/0x12c) from [] (gic_handle_irq+0x54/0x5c) [] (gic_handle_irq+0x54/0x5c) from [] (__irq_svc+0x40/0x50) Exception stack(0xef079fa0 to 0xef079fe8) 9fa0: c0ddd6d8 00000000 000002d2 00000000 ef078000 c04888f5 00000001 c04888f5 9fc0: c045c490 c045c42c c0348f38 00000000 01000000 ef079fe8 c000f018 c000f01c 9fe0: 60000113 ffffffff [] (__irq_svc+0x40/0x50) from [] (arch_cpu_idle+0x28/0x30) [] (arch_cpu_idle+0x28/0x30) from [] (cpu_startup_entry+0x60/0x130) [] (cpu_startup_entry+0x60/0x130) from [<6033dfc4>] (0x6033dfc4) Initially detected when booting Stih415 SOC with multi_v7_defconfig. Signed-off-by: Srinivas Kandagatla --- arch/arm/mach-prima2/common.c | 3 +++ arch/arm/mach-prima2/pm.c | 6 ++---- arch/arm/mach-prima2/pm.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index 9aefcd6..8e27cb7 100644 --- a/arch/arm/mach-prima2/common.c +++ b/arch/arm/mach-prima2/common.c @@ -16,6 +16,7 @@ #include #include #include "common.h" +#include "pm.h" static struct of_device_id sirfsoc_of_bus_ids[] __initdata = { { .compatible = "simple-bus", }, @@ -24,6 +25,8 @@ static struct of_device_id sirfsoc_of_bus_ids[] __initdata = { void __init sirfsoc_mach_init(void) { + sirfsoc_of_pwrc_init(); + sirfsoc_memc_init(); of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL); } diff --git a/arch/arm/mach-prima2/pm.c b/arch/arm/mach-prima2/pm.c index 9936c18..8850e3b 100644 --- a/arch/arm/mach-prima2/pm.c +++ b/arch/arm/mach-prima2/pm.c @@ -96,7 +96,7 @@ static const struct of_device_id pwrc_ids[] = { {} }; -static int __init sirfsoc_of_pwrc_init(void) +int __init sirfsoc_of_pwrc_init(void) { struct device_node *np; @@ -116,7 +116,6 @@ static int __init sirfsoc_of_pwrc_init(void) return 0; } -postcore_initcall(sirfsoc_of_pwrc_init); static const struct of_device_id memc_ids[] = { { .compatible = "sirf,prima2-memc" }, @@ -143,8 +142,7 @@ static struct platform_driver sirfsoc_memc_driver = { }, }; -static int __init sirfsoc_memc_init(void) +int __init sirfsoc_memc_init(void) { return platform_driver_register(&sirfsoc_memc_driver); } -postcore_initcall(sirfsoc_memc_init); diff --git a/arch/arm/mach-prima2/pm.h b/arch/arm/mach-prima2/pm.h index bae6d77..b658d66 100644 --- a/arch/arm/mach-prima2/pm.h +++ b/arch/arm/mach-prima2/pm.h @@ -23,6 +23,8 @@ #ifndef __ASSEMBLY__ extern int sirfsoc_finish_suspend(unsigned long); +extern int __init sirfsoc_of_pwrc_init(void); +extern int __init sirfsoc_memc_init(void); #endif #endif