From patchwork Wed Aug 28 16:19:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 2850906 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15D43BF546 for ; Wed, 28 Aug 2013 16:20:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 069B6204A9 for ; Wed, 28 Aug 2013 16:20:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47CC020123 for ; Wed, 28 Aug 2013 16:20:36 +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 1VEiTx-00087P-ER; Wed, 28 Aug 2013 16:20:33 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEiTv-0002aZ-7d; Wed, 28 Aug 2013 16:20:31 +0000 Received: from mail-oa0-x22a.google.com ([2607:f8b0:4003:c02::22a]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEiTr-0002Zm-Sz for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2013 16:20:28 +0000 Received: by mail-oa0-f42.google.com with SMTP id j10so604899oah.15 for ; Wed, 28 Aug 2013 09:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wfh9XSM++W0j6aFLTx7DfM/rNbWwahacMeKkShhzeEI=; b=lFRrjCXHw0POVcw2hG/BKNlUHMoSdkQKR3f6akbKKYqJzwP4Pmo/jTBt/8RFVOnvtw jSSC/0k2Em5zsymXs3yYKhYImtmDrBrOX/XICHm+mcyqJaGIUBBEvXNFDrX5ab3yjxkT eg/c99DV0Ab9HhUQa5KSUuaLKQ7PAxGIqCcw7Ur/VkJ9STVneUnIH2AqcN/2itRwOzi0 HESk17sIAVviHnVQXXtCzZM2z8iL0v5cfeRYN/ONm/1CkuYB+lNDtjj5eHh+1nZaDJRx fUtY2S16nT9mq77wmsecPoGYenvpVimMONmgySb+j0u72Nhk5D7boDLaJC4NSL1EmTQC MluQ== X-Received: by 10.182.72.137 with SMTP id d9mr6968708obv.99.1377706806519; Wed, 28 Aug 2013 09:20:06 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPSA id ps5sm27451245oeb.8.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 09:20:05 -0700 (PDT) From: Rob Herring To: xen-devel@lists.xensource.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: xen: only set pm function ptrs for Xen guests Date: Wed, 28 Aug 2013 11:19:54 -0500 Message-Id: <1377706794-8481-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130828_122028_011638_7BB5AD0B X-CRM114-Status: GOOD ( 10.26 ) X-Spam-Score: -1.8 (-) Cc: Rob Herring , Stefano Stabellini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rob Herring xen_pm_init was unconditionally setting pm_power_off and arm_pm_restart function pointers. This breaks multi-platform kernels. Move this initialization into xen_guest_init, so it is conditional on running as a Xen guest. Cc: Stefano Stabellini Signed-off-by: Rob Herring --- This breaks reset and poweroff for Midway when Xen is enabled. This should go into 3.11 or stable. Rob arch/arm/xen/enlighten.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 8a6295c..fa86452 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -263,6 +263,9 @@ static int __init xen_guest_init(void) if (xen_vcpu_info == NULL) return -ENOMEM; + pm_power_off = xen_power_off; + arm_pm_restart = xen_restart; + gnttab_init(); if (!xen_initial_domain()) xenbus_probe(NULL); @@ -271,15 +274,6 @@ static int __init xen_guest_init(void) } core_initcall(xen_guest_init); -static int __init xen_pm_init(void) -{ - pm_power_off = xen_power_off; - arm_pm_restart = xen_restart; - - return 0; -} -subsys_initcall(xen_pm_init); - static irqreturn_t xen_arm_callback(int irq, void *arg) { xen_hvm_evtchn_do_upcall();