From patchwork Thu Mar 24 14:44:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 64377 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp697684lbc; Thu, 24 Mar 2016 07:48:45 -0700 (PDT) X-Received: by 10.66.55.39 with SMTP id o7mr13205212pap.13.1458830889131; Thu, 24 Mar 2016 07:48:09 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tr4si12608667pac.222.2016.03.24.07.48.08; Thu, 24 Mar 2016 07:48:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757661AbcCXOsD (ORCPT + 7 others); Thu, 24 Mar 2016 10:48:03 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:32900 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752368AbcCXOr7 (ORCPT ); Thu, 24 Mar 2016 10:47:59 -0400 Received: by mail-pa0-f51.google.com with SMTP id fl4so23852765pad.0 for ; Thu, 24 Mar 2016 07:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lX1+wpZyWUpcRkrkLFXM9Im7UQffEy29m3908BxOtZE=; b=CixW/7tchmCHAumlULy4NxLZwXMI33Ygzxc4iN6R20MoL/1RsfFxQPZgvNzR4VvW3l URQatHvUheafiivDzLwuL4iEZ3MymIT6qULVWxA2toY/1BX+P9Lg9psC5Spdx/xngWAP KE7y2cs0dbz3MELwoUlkU76S0/1SOSlybq7D4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lX1+wpZyWUpcRkrkLFXM9Im7UQffEy29m3908BxOtZE=; b=NfztouIO9ClErnd9lopVLJTRWGgaz8OiBsJ1YfZUZqM+M6Jfo2FHkPGE4BPRzHMRa2 tJ3nUoM5O5N5loSPbcr1kvwoPV7Jf8jvYk8lt0RH+bV0L+YOcvsWPsF8CffuF8Jfom44 tv1ImLLRZ9wwH18TMgDXnZV69Aq4+1nKSs622ggYMlAsKtTgQ5J8o6H8IRcsbTCiq4U8 p+7HndNT9jE23C6glDWY4ao7dTcO7txMhRxrk/VqntQBYiBtiQkQiRgTFjrA8qOY8u3B vZwTvAniNNW+ZLgJfiHg/QkrzOEvmXs55BHAlcvYqX0OUePcIxlVapkzRY6igv8kl7EU WrdA== X-Gm-Message-State: AD7BkJJkwV+fCyDHKToZOzlx4HFadID1O4Jm80P69I+1WUbaPszTClgZxHj/hUkT+brqh6pV X-Received: by 10.66.248.168 with SMTP id yn8mr13373673pac.24.1458830877837; Thu, 24 Mar 2016 07:47:57 -0700 (PDT) Received: from localhost.localdomain ([104.238.45.135]) by smtp.gmail.com with ESMTPSA id lq10sm10780673pab.36.2016.03.24.07.47.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2016 07:47:56 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com, david.vrabel@citrix.com Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, julien.grall@arm.com, peter.huangpeng@huawei.com, xen-devel@lists.xen.org, zhaoshenglong@huawei.com, shannon.zhao@linaro.org Subject: [PATCH v7 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI Date: Thu, 24 Mar 2016 22:44:31 +0800 Message-Id: <1458830676-27075-13-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> References: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org When it's a Xen domain0 booting with ACPI, it will supply a /chosen and a /hypervisor node in DT. So check if it needs to enable ACPI. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Hanjun Guo --- arch/arm64/kernel/acpi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..4e92be0 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -67,10 +67,13 @@ static int __init dt_scan_depth1_nodes(unsigned long node, { /* * Return 1 as soon as we encounter a node at depth 1 that is - * not the /chosen node. + * not the /chosen node, or /hypervisor node when running on Xen. */ - if (depth == 1 && (strcmp(uname, "chosen") != 0)) - return 1; + if (depth == 1 && (strcmp(uname, "chosen") != 0)) { + if (!xen_initial_domain() || (strcmp(uname, "hypervisor") != 0)) + return 1; + } + return 0; } @@ -184,7 +187,8 @@ void __init acpi_boot_table_init(void) /* * Enable ACPI instead of device tree unless * - ACPI has been disabled explicitly (acpi=off), or - * - the device tree is not empty (it has more than just a /chosen node) + * - the device tree is not empty (it has more than just a /chosen node, + * and a /hypervisor node when running on Xen) * and ACPI has not been force enabled (acpi=force) */ if (param_acpi_off ||