From patchwork Thu Aug 29 12:43:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 2851301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57ECE9F485 for ; Thu, 29 Aug 2013 12:44:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B7072031A for ; Thu, 29 Aug 2013 12:44:38 +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 17B5820316 for ; Thu, 29 Aug 2013 12:44:37 +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 1VF1aU-0004I6-Jw; Thu, 29 Aug 2013 12:44:34 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF1aR-00021W-VF; Thu, 29 Aug 2013 12:44:31 +0000 Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VF1aP-000209-IX for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2013 12:44:30 +0000 Received: by mail-ob0-f178.google.com with SMTP id ef5so389237obb.37 for ; Thu, 29 Aug 2013 05:44: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=OtPTrswQcaeqtdousbjOW2Aiz6H+ctENpqaX11O/PFU=; b=e9AmFA/24fQaoRd+8T2MGjxnjIhznQ3vyxMT80peMApDDSsouWtBns6UJRs2HtHxZv JYbMDQWtiqsTx1tik3aj2njwrKZMmfmRAnZQFSprXbFeK+8P0FYBHOXm1ng18pirit8t itpsQ7FtUr7UR66Yk6i+dsHpQpKyoSp+e8tHp3fZSXsyow+1teBvI8TOu4xHhF/gOi0R EAs1oRTguR/zFk8fe+WkFXlC5hoXWE+YpXhgjqdJ4sVjL7m42+vUuOXnBuiVQihb0+9Y 9yN7ILeX3RlWn69+QDYOO6tV3ntUQjgOUGixClxCoEUqXaXrn6yoF1/dODsWi59m8sb9 daZw== X-Received: by 10.60.138.136 with SMTP id qq8mr1243541oeb.59.1377780246335; Thu, 29 Aug 2013 05:44:06 -0700 (PDT) Received: from rob-laptop.grandenetworks.net (65-36-73-129.dyn.grandenetworks.net. [65.36.73.129]) by mx.google.com with ESMTPSA id pt4sm31265434obb.14.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Aug 2013 05:44: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 v3] ARM: xen: only set pm function ptrs for Xen guests Date: Thu, 29 Aug 2013 07:43:52 -0500 Message-Id: <1377780232-13545-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-20130829_084429_711898_E7127978 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) Cc: julien.grall@linaro.org, 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. Make this conditional on running as a Xen guest and make it a late_initcall to ensure it is setup after platform code for Dom0. Cc: Stefano Stabellini Signed-off-by: Rob Herring Acked-by: Stefano Stabellini --- arch/arm/xen/enlighten.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 8a6295c..7071fca 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -273,12 +273,15 @@ core_initcall(xen_guest_init); static int __init xen_pm_init(void) { + if (!xen_domain()) + return -ENODEV; + pm_power_off = xen_power_off; arm_pm_restart = xen_restart; return 0; } -subsys_initcall(xen_pm_init); +late_initcall(xen_pm_init); static irqreturn_t xen_arm_callback(int irq, void *arg) {