From patchwork Fri May 31 09:45:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas KANDAGATLA X-Patchwork-Id: 2641391 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 310ACDFB79 for ; Fri, 31 May 2013 09:55:05 +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 1UiM2c-00049V-H4; Fri, 31 May 2013 09:54:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiM2T-0004th-9a; Fri, 31 May 2013 09:54:25 +0000 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiM2H-0004rX-ID for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 09:54:15 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUahzKdTTDqA4Ijvi4xJr9qeG9UEQifYZ@postini.com; Fri, 31 May 2013 09:54:13 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 63E941DF; Fri, 31 May 2013 09:53:44 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BE64E4BCE; Fri, 31 May 2013 09:53:26 +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 BEM69587 (AUTH srinivak); Fri, 31 May 2013 11:53:43 +0200 From: Srinivas KANDAGATLA To: Barry Song Subject: [PATCH v1 1/2] ARM:prima2: move sirfsoc_of_rstc_init to .init_early Date: Fri, 31 May 2013 10:45:01 +0100 Message-Id: <1369993501-24309-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_055413_865490_13F2B536 X-CRM114-Status: GOOD ( 16.29 ) 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.149 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 sirfsoc_of_rstc_init from early_initcall to .init_early in machine descriptor, doing this way a multi_v7 kernel will not crash on non-prima2 SOCs. Without this patch the multi_v7 kernel panics if we boot it on any non prima2 parts with below log: Kernel panic - not syncing: unable to find compatible rstc node in dtb CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0-rc3-00535-gc3cc4ac #62 [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) [] (show_stack+0x10/0x14) from [] (panic+0x90/0x1e4) [] (panic+0x90/0x1e4) from [] (sirfsoc_of_rstc_init+0x24/0x5c) [] (sirfsoc_of_rstc_init+0x24/0x5c) from [] (do_one_initcall+0x90/0x150) [] (do_one_initcall+0x90/0x150) from [] (kernel_init_freeable+0x64/0x1c4) [] (kernel_init_freeable+0x64/0x1c4) from [] (kernel_init+0x8/0xe4) [] (kernel_init+0x8/0xe4) from [] (ret_from_fork+0x14/0x3c) 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/common.h | 1 + arch/arm/mach-prima2/rstc.c | 5 +---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index 4f94cd8..9aefcd6 100644 --- a/arch/arm/mach-prima2/common.c +++ b/arch/arm/mach-prima2/common.c @@ -61,6 +61,7 @@ DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)") .init_late = sirfsoc_init_late, .dt_compat = atlas6_dt_match, .restart = sirfsoc_restart, + .init_early = sirfsoc_of_rstc_init, MACHINE_END #endif @@ -81,6 +82,7 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") .init_late = sirfsoc_init_late, .dt_compat = prima2_dt_match, .restart = sirfsoc_restart, + .init_early = sirfsoc_of_rstc_init, MACHINE_END #endif @@ -100,5 +102,6 @@ DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)") .init_late = sirfsoc_init_late, .dt_compat = marco_dt_match, .restart = sirfsoc_restart, + .init_early = sirfsoc_of_rstc_init, MACHINE_END #endif diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h index 81135cd..65703a4 100644 --- a/arch/arm/mach-prima2/common.h +++ b/arch/arm/mach-prima2/common.h @@ -20,6 +20,7 @@ extern struct smp_operations sirfsoc_smp_ops; extern void sirfsoc_secondary_startup(void); extern void sirfsoc_cpu_die(unsigned int cpu); +extern void sirfsoc_of_rstc_init(void); extern void __init sirfsoc_of_irq_init(void); extern void __init sirfsoc_of_clk_init(void); extern void sirfsoc_restart(char, const char *); diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 435019c..5506425 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -23,7 +23,7 @@ static struct of_device_id rstc_ids[] = { {}, }; -static int __init sirfsoc_of_rstc_init(void) +void sirfsoc_of_rstc_init(void) { struct device_node *np; @@ -36,10 +36,7 @@ static int __init sirfsoc_of_rstc_init(void) panic("unable to map rstc cpu registers\n"); of_node_put(np); - - return 0; } -early_initcall(sirfsoc_of_rstc_init); int sirfsoc_reset_device(struct device *dev) {