From patchwork Wed Apr 30 19:54:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 344310 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 940A4141300 for ; Thu, 1 May 2014 06:10:55 +1000 (EST) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0204.outbound.protection.outlook.com [207.46.163.204]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DC02914029E for ; Thu, 1 May 2014 06:09:54 +1000 (EST) Received: from BY2PR03CA057.namprd03.prod.outlook.com (10.141.249.30) by BY2PR03MB345.namprd03.prod.outlook.com (10.141.139.11) with Microsoft SMTP Server (TLS) id 15.0.934.12; Wed, 30 Apr 2014 19:54:17 +0000 Received: from BN1AFFO11FD031.protection.gbl (2a01:111:f400:7c10::112) by BY2PR03CA057.outlook.office365.com (2a01:111:e400:2c5d::30) with Microsoft SMTP Server (TLS) id 15.0.929.12 via Frontend Transport; Wed, 30 Apr 2014 19:54:17 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.1) by BN1AFFO11FD031.mail.protection.outlook.com (10.58.52.185) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Wed, 30 Apr 2014 19:54:16 +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 s3UJsD3L000908; Wed, 30 Apr 2014 12:54:15 -0700 From: Stuart Yoder To: , Subject: [PATCH] powerpc: move epapr paravirt init of power_save to an initcall Date: Wed, 30 Apr 2014 14:54:01 -0500 Message-ID: <1398887641-20705-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)(979002)(6009001)(428001)(199002)(189002)(47776003)(20776003)(92566001)(62966002)(83072002)(85852003)(46102001)(76482001)(89996001)(50226001)(77982001)(88136002)(87936001)(33646001)(80022001)(4396001)(36756003)(50466002)(77156001)(80976001)(48376002)(19580405001)(81342001)(101416001)(99396002)(77096999)(6806004)(81542001)(93916002)(87286001)(31966008)(86362001)(74502001)(92726001)(79102001)(19580395003)(74662001)(50986999)(44976005)(83322001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB345; H:tx30smr01.am.freescale.net; FPR:; MLV:ovrnspm; PTR:gate-tx3.freescale.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Forefront-PRVS: 0197AFBD92 Received-SPF: None (: freescale.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 192.88.168.1) smtp.mailfrom=stuart.yoder@freescale.com; 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 --- 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 6300c13..c49b69c 100644 --- a/arch/powerpc/kernel/epapr_paravirt.c +++ b/arch/powerpc/kernel/epapr_paravirt.c @@ -52,11 +52,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; @@ -69,3 +64,23 @@ int __init epapr_paravirt_early_init(void) return 0; } +static int __init epapr_idle_init_dt_scan(unsigned long node, + const char *uname, + int depth, void *data) +{ +#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 + return 0; +} + +static int __init epapr_idle_init(void) +{ + if (epapr_paravirt_enabled) + of_scan_flat_dt(epapr_idle_init_dt_scan, NULL); + + return 0; +} + +postcore_initcall(epapr_idle_init);