From patchwork Wed Aug 28 18:20:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 2850936 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 1A92DBF546 for ; Wed, 28 Aug 2013 18:20:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01AEF202EC for ; Wed, 28 Aug 2013 18:20:44 +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 C17C6202C8 for ; Wed, 28 Aug 2013 18:20:42 +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 1VEkMC-0002U8-Jg; Wed, 28 Aug 2013 18:20:40 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEkMA-0005wT-Ao; Wed, 28 Aug 2013 18:20:38 +0000 Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VEkM7-0005va-4D for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2013 18:20:35 +0000 Received: by mail-ob0-f179.google.com with SMTP id fb19so7146154obc.10 for ; Wed, 28 Aug 2013 11:20:13 -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=5bpR6xjMv4hvT8FV+jxY304aBR2+YnmtbOmk3l+1ZBM=; b=v+cHICkA3Et43uyii+0uSCH6uPFidADe5Y4Lzj3EFtp27D2MNJUORbtRHvtaF37bNS g8RjJhLC2Bb35EQcrSNFwvoTHOp4pgV3Lh280+nZjXkoLkJcMFJn3swIDYeIM3DHnxGY Xpno1B4ftv9QmJBHVT6FD3nkDJJ0rThu6dawkShQcic3H0CSIu38FQBrimaNRGUNOEnn LPht6QZiD+RvRu2PYWqufKDHJ2d1avIIeE4E56AcQE+/VMkkEGXh0JwxQaFldolpcCQO lH1fHxYi0vr9jTuvvAT/DTobIV7XCVRJDiTRuZ0rSzoOTCRV4FXHWnb/s6u8xYHYjZ6N OJ7Q== X-Received: by 10.60.52.81 with SMTP id r17mr24633119oeo.3.1377714013790; Wed, 28 Aug 2013 11:20:13 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPSA id qi5sm27166093obb.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 11:20:13 -0700 (PDT) From: Rob Herring To: xen-devel@lists.xensource.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ARM: xen: only set pm function ptrs for Xen guests Date: Wed, 28 Aug 2013 13:20:03 -0500 Message-Id: <1377714003-22096-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_142035_230125_48C6415F X-CRM114-Status: UNSURE ( 9.76 ) 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 --- 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..13a7d1f 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 (!of_find_compatible_node(NULL, NULL, "xen,xen")) + 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) {