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: 64873 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp811467lbc; Fri, 1 Apr 2016 08:51:44 -0700 (PDT) X-Received: by 10.66.136.78 with SMTP id py14mr25356297pab.113.1459525900197; Fri, 01 Apr 2016 08:51:40 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si22055687pat.92.2016.04.01.08.51.39; Fri, 01 Apr 2016 08:51:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932599AbcDAPvY (ORCPT + 29 others); Fri, 1 Apr 2016 11:51:24 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33940 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932572AbcDAPvT (ORCPT ); Fri, 1 Apr 2016 11:51:19 -0400 Received: by mail-pa0-f44.google.com with SMTP id fe3so93915738pab.1 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=Ko70FTceoe3XRqmFX8T2YlEKKTP+2iIDYbufkt/ZciGqPz0deMefYIXXMnehsEDgH5 hrGcIq67Fu6FGBmoOYUku8rEVhgLfgVAcFRprNzEDzNW+cLWJucnQYDNJjSkmVTnHryl pknW4hq6dKduT2kpelA/R/yAtszHEMSrtVgQF/miyuK/QaHLU/k9B+ogtWSqEBaSrEe1 ZPACW8wSCkwbIuTpjcfVDoOT5Yi9a3gaSm3XJj1aRIQ2E1LmIAZBVNC6F39lgtkyYvpA CDRu4j40teC/g70aoehJV2M2uMIpx/WbzRVb3TGnUZUOOwpBisvxhVeWP2mZj09ZubLq KFPA== X-Gm-Message-State: AD7BkJIklS6jrXt4r6+HZKWYnyzqNlIAC3hsI4OGrGBkwLEjs7463KqR8LAIzzLCFbQTDZE5 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 Cc: david.vrabel@citrix.com, 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 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -- 2.1.4 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 ||