From patchwork Fri May 17 06:35:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas KANDAGATLA X-Patchwork-Id: 2581231 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 90175DF215 for ; Fri, 17 May 2013 06:42:23 +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 1UdEMv-0007ei-Sr; Fri, 17 May 2013 06:42:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdEMt-0008TP-6A; Fri, 17 May 2013 06:42:19 +0000 Received: from eu1sys200aog118.obsmtp.com ([207.126.144.145]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdEMp-0008Sq-D5 for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 06:42:16 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUZXRKi9bN88I+CQHZ2OIVxrKq/pZR1jY@postini.com; Fri, 17 May 2013 06:42:15 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 DD430367; Fri, 17 May 2013 06:41:31 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A387D44AA; Fri, 17 May 2013 06:41:18 +0000 (GMT) Received: from [10.65.51.59] (king.bri.st.com [10.65.51.59]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BDP65446 (AUTH srinivak); Fri, 17 May 2013 08:41:30 +0200 Message-ID: <5195CFB3.4090905@st.com> Date: Fri, 17 May 2013 07:35:31 +0100 From: Srinivas KANDAGATLA Organization: STMicroelectronics User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Barry Song <21cnbao@gmail.com> Subject: Re: [PATCH] ARM: prima2: return rather than panic on missing DT nodes References: <1368719437-28287-1-git-send-email-robherring2@gmail.com> <519510A4.8090904@st.com> In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130517_024215_779183_14C95151 X-CRM114-Status: GOOD ( 20.90 ) 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.145 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: DL-SHA-WorkGroupLinux , arm@kernel.org, Rob Herring , Barry Song , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: srinivas.kandagatla@st.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On 17/05/13 01:30, Barry Song wrote: > then it turns out that moving the codes to callbacks of machine is the > right way. i will take care the init ordering issues. Not sure if this helps but, I have done a patch for this yesterday to fix few more issues when booting with multi_v7_defconfig then the one pointed out by Rob . --srini From 49a3fd50b24426b59a5811f0dd11c32e737ef245 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Thu, 16 May 2013 17:52:25 +0100 Subject: [RFC] ARM: prima2: remove early and postcore initcalls. This patch removes early_init and postcore_initcalls from the mach layer to MACHINE callbacks. Signed-off-by: Srinivas Kandagatla --- arch/arm/mach-prima2/common.c | 6 ++++++ arch/arm/mach-prima2/common.h | 1 + arch/arm/mach-prima2/pm.c | 6 ++---- arch/arm/mach-prima2/pm.h | 2 ++ arch/arm/mach-prima2/rstc.c | 5 +---- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index 4f94cd8..52833a6 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); } @@ -61,6 +64,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 +85,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 +105,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/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 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