From patchwork Fri Apr 1 15:49:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8726331 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4CE63C0553 for ; Fri, 1 Apr 2016 15:57:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 765E1201FA for ; Fri, 1 Apr 2016 15:57:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 97D9720145 for ; Fri, 1 Apr 2016 15:57:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1QN-0000jA-AV; Fri, 01 Apr 2016 15:55:51 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1am1MN-00041O-H6 for linux-arm-kernel@bombadil.infradead.org; Fri, 01 Apr 2016 15:51:43 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1am1ML-0006s8-OV for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2016 15:51:42 +0000 Received: by mail-pa0-x22f.google.com with SMTP id tt10so93805703pab.3 for ; Fri, 01 Apr 2016 08:51:19 -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=pBJayU8Ld1xjdP1tj71NmVKrPPyHd0jFVv1ewUKL9wA=; b=TLXsjMxlSrL3Gf/9omEF1IHRKLKuu5UVFs0YaQXv7UGn2r9jO0eWVmBbVTQ7gYDfUA db5xm0i6cn83qSpV5tSwjfnDTX2SqlkySExeIEjzIBvhxr5HohN8bgHTz7rGhNRTaOAL /x/d0fi+6pfdmVe62W81BDAW7aQCogo8YL3Q4= 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=pBJayU8Ld1xjdP1tj71NmVKrPPyHd0jFVv1ewUKL9wA=; b=FnuSMH+6Cv0mPjTMqlZsVT0thk0t5secTAzVspD6lchdFSUAsniS9qu78zZqncIwov Eof6TZS2o3laq0MNnwTm4P1kKBIzt7WJVI6amer5z+zZGV+lsO5UtJt0APBzLLllRhra 8dMkmusgOHF8w8/LCKwYBn7qmhCU1kS/aUiCvisy2as47+LqPsRZhOPjjbPC4dr4Ju7h m/HTkRLCBQQnM3gm+4VWc0uE4qoT7kpGUXC8nLA4aXGOKDhKDW9D+tkyEtl1ghT7+yI0 nDIZiIWIi2ESbo7z748L3+2ioGEHUfOX8xfohqkNAZPf/eWSvy9+YKdW57w9flBlPv0c HhVA== X-Gm-Message-State: AD7BkJKlgFFKgfiWv93X0bsS7nv7V1dJ+6KUZcirTIfzDLM8iDZJ7ojw9U2BLc8K8jXBx4yT X-Received: by 10.66.63.98 with SMTP id f2mr4274417pas.123.1459525878600; Fri, 01 Apr 2016 08:51:18 -0700 (PDT) Received: from localhost.localdomain ([167.160.116.218]) by smtp.gmail.com with ESMTPSA id yj1sm22536791pac.16.2016.04.01.08.51.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2016 08:51:17 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com Subject: [PATCH v10 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI Date: Fri, 1 Apr 2016 23:49:10 +0800 Message-Id: <1459525755-36968-13-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> References: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160401_115141_931526_CE80695A X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, peter.huangpeng@huawei.com, julien.grall@arm.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, xen-devel@lists.xen.org, shannon.zhao@linaro.org 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=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..57ee317 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -67,10 +67,15 @@ 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 with compatible + * string "xen,xen". */ - if (depth == 1 && (strcmp(uname, "chosen") != 0)) - return 1; + if (depth == 1 && (strcmp(uname, "chosen") != 0)) { + if (strcmp(uname, "hypervisor") != 0 || + !of_flat_dt_is_compatible(node, "xen,xen")) + return 1; + } + return 0; } @@ -184,7 +189,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 ||