From patchwork Wed Apr 30 23:23:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Yoder X-Patchwork-Id: 344369 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 681A714013E for ; Thu, 1 May 2014 09:23:59 +1000 (EST) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0142.outbound.protection.outlook.com [207.46.163.142]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 22F651400F6 for ; Thu, 1 May 2014 09:23:23 +1000 (EST) Received: from BL2PR03CA014.namprd03.prod.outlook.com (10.141.66.22) by BL2PR03MB388.namprd03.prod.outlook.com (10.141.91.153) with Microsoft SMTP Server (TLS) id 15.0.934.12; Wed, 30 Apr 2014 23:23:18 +0000 Received: from BL2FFO11FD034.protection.gbl (2a01:111:f400:7c09::110) by BL2PR03CA014.outlook.office365.com (2a01:111:e400:c1b::22) with Microsoft SMTP Server (TLS) id 15.0.934.12 via Frontend Transport; Wed, 30 Apr 2014 23:23:18 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.1) by BL2FFO11FD034.mail.protection.outlook.com (10.173.161.130) with Microsoft SMTP Server (TLS) id 15.0.929.8 via Frontend Transport; Wed, 30 Apr 2014 23:23:17 +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 s3UNNEZh018754; Wed, 30 Apr 2014 16:23:15 -0700 From: Stuart Yoder To: , Subject: [PATCH][v3] powerpc: move epapr paravirt init of power_save to an initcall Date: Wed, 30 Apr 2014 18:23:12 -0500 Message-ID: <1398900192-2646-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)(199002)(189002)(86362001)(83072002)(79102001)(93916002)(33646001)(101416001)(87936001)(50466002)(85852003)(44976005)(50986999)(20776003)(47776003)(50226001)(81542001)(6806004)(4396001)(81342001)(99396002)(74662001)(80976001)(74502001)(31966008)(80022001)(19580395003)(36756003)(62966002)(89996001)(92726001)(77982001)(87286001)(77156001)(92566001)(77096999)(83322001)(76482001)(46102001)(48376002)(19580405001)(88136002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR03MB388; H:tx30smr01.am.freescale.net; FPR:; MLV:sfv; 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 --- -v3 -changed approach slightly, set flag in the dt scanning code and just look at that flag in the initcall arch/powerpc/kernel/epapr_paravirt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c index 7898be9..6596cd7 100644 --- a/arch/powerpc/kernel/epapr_paravirt.c +++ b/arch/powerpc/kernel/epapr_paravirt.c @@ -30,6 +30,7 @@ extern u32 epapr_ev_idle_start[]; #endif bool epapr_paravirt_enabled; +bool epapr_has_idle; static int __init early_init_dt_scan_epapr(unsigned long node, const char *uname, @@ -55,7 +56,7 @@ static int __init early_init_dt_scan_epapr(unsigned long node, #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; + epapr_has_idle = true; #endif epapr_paravirt_enabled = true; @@ -70,3 +71,12 @@ int __init epapr_paravirt_early_init(void) return 0; } +static int __init epapr_idle_init(void) +{ + if (epapr_has_idle) + ppc_md.power_save = epapr_ev_idle; + + return 0; +} + +postcore_initcall(epapr_idle_init);