Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753229Ab3EaJy1 (ORCPT ); Fri, 31 May 2013 05:54:27 -0400 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]:37319 "EHLO eu1sys200aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203Ab3EaJyN (ORCPT ); Fri, 31 May 2013 05:54:13 -0400 From: Srinivas KANDAGATLA To: Barry Song Cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla 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> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3673 Lines: 106 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) { -- 1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/