From patchwork Wed Apr 30 20:20:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 344312 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id A680F140118 for ; Thu, 1 May 2014 06:21:01 +1000 (EST) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0244.outbound.protection.outlook.com [207.46.163.244]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AF4D71400A5 for ; Thu, 1 May 2014 06:20:29 +1000 (EST) Received: from BLUPR03CA035.namprd03.prod.outlook.com (10.141.30.28) by BLUPR03MB391.namprd03.prod.outlook.com (10.141.78.21) with Microsoft SMTP Server (TLS) id 15.0.929.12; Wed, 30 Apr 2014 20:20:24 +0000 Received: from BY2FFO11FD027.protection.gbl (2a01:111:f400:7c0c::104) by BLUPR03CA035.outlook.office365.com (2a01:111:e400:879::28) with Microsoft SMTP Server (TLS) id 15.0.934.12 via Frontend Transport; Wed, 30 Apr 2014 20:20:24 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.1) by BY2FFO11FD027.mail.protection.outlook.com (10.1.15.216) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Wed, 30 Apr 2014 20:20:23 +0000 Received: from right.am.freescale.net (right.am.freescale.net [10.81.116.70]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id s3UKKK6c015540; Wed, 30 Apr 2014 13:20:20 -0700 From: Stuart Yoder To: , Subject: [PATCH][v2] powerpc: move epapr paravirt init of power_save to an initcall Date: Wed, 30 Apr 2014 15:20:09 -0500 Message-ID: <1398889209-10350-1-git-send-email-stuart.yoder@freescale.com> X-Mailer: git-send-email 1.7.9.7 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.1; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(6009001)(428001)(189002)(199002)(74662001)(76482001)(74502001)(48376002)(99396002)(87286001)(50226001)(36756003)(80976001)(62966002)(81542001)(80022001)(77156001)(4396001)(92566001)(46102001)(44976005)(20776003)(85852003)(101416001)(33646001)(6806004)(47776003)(50986999)(50466002)(87936001)(19580395003)(92726001)(93916002)(88136002)(86362001)(81342001)(89996001)(31966008)(83322001)(83072002)(79102001)(77096999)(77982001)(19580405001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR03MB391; H:tx30smr01.am.freescale.net; FPR:FA8DD152.3D12B7CB.B1F7AF47.88A21ABD.201E7; MLV:sfv; PTR:gate-tx3.freescale.com; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Forefront-PRVS: 0197AFBD92 Received-SPF: None (: freescale.com does not designate permitted sender hosts) X-OriginatorOrg: freescale.com Cc: linuxppc-dev@lists.ozlabs.org, agraf@suse.de, Stuart Yoder X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Stuart Yoder some restructuring of epapr paravirt init resulted in ppc_md.power_save being set, and then overwritten to NULL during machine_init. This patch splits the initialization of ppc_md.power_save out into a postcore init call. Signed-off-by: Stuart Yoder --- -v2: don't iterate over the entire DT, just look at the hypervisor node arch/powerpc/kernel/epapr_paravirt.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c index 7898be9..a01df5e 100644 --- a/arch/powerpc/kernel/epapr_paravirt.c +++ b/arch/powerpc/kernel/epapr_paravirt.c @@ -53,11 +53,6 @@ static int __init early_init_dt_scan_epapr(unsigned long node, #endif } -#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) - if (of_get_flat_dt_prop(node, "has-idle", NULL)) - ppc_md.power_save = epapr_ev_idle; -#endif - epapr_paravirt_enabled = true; return 1; @@ -70,3 +65,23 @@ int __init epapr_paravirt_early_init(void) return 0; } +static int __init epapr_idle_init(void) +{ + struct device_node *node; + + if (!epapr_paravirt_enabled) + return 0; + + node = of_find_node_by_path("/hypervisor"); + if (!node) + return -ENODEV; + +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) + if (of_get_property(node, "has-idle", NULL)) + ppc_md.power_save = epapr_ev_idle; +#endif + + return 0; +} + +postcore_initcall(epapr_idle_init);