From patchwork Tue Nov 17 09:57:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56777 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1831410lbb; Tue, 17 Nov 2015 01:58:51 -0800 (PST) X-Received: by 10.68.198.101 with SMTP id jb5mr35803930pbc.119.1447754331292; Tue, 17 Nov 2015 01:58:51 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf5si8652772pbc.205.2015.11.17.01.58.51; Tue, 17 Nov 2015 01:58:51 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753559AbbKQJ6t (ORCPT + 6 others); Tue, 17 Nov 2015 04:58:49 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38159 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497AbbKQJ6q (ORCPT ); Tue, 17 Nov 2015 04:58:46 -0500 Received: by wmec201 with SMTP id c201so17743188wme.1 for ; Tue, 17 Nov 2015 01:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ccnV1sfpMMrTryLvHfu/dtp3bLdRcrdSq1RZ6mdw1t4=; b=e2ngUrrwA0kkQjBVIPLf59VNWUa2iHUjsxm4oeJszqamJ969Do0FZcJntJgj/J+gOi DzhIMrJK+qPxaLi0rA870hr0SakC5+AqbBP2PBXB7sia33n7r7cQ+Tl4i2JXez31iA8j 3UiNp7E9nB7A/FGU3/4wDppbngzs38iJZhmz8XdhDIRlB3rB2kx0O7jhIoYQDSAz6kYR bc4aDSmSCZbmY7rPHRqy2QSHcUDg7Vl+7QNqkNI4/E/+laNBxXuyJkYAIQfl23wjrjQX wqS+7gouD1LmmNCPyH02VegftywsCtzezGzG8b7iw99zEz1WhLPfyDpPXj/pnQXlZOoT C8Og== 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=ccnV1sfpMMrTryLvHfu/dtp3bLdRcrdSq1RZ6mdw1t4=; b=H9XgFvNdw5FFbw+Ly8gv3R6++xoh4gppmjluhOfPzcdwZKZXccRxcKg3lgUnV7E7e1 X0J+iZCoPEm41XBp15JNP/8kP/47+5XlQPCZNN42t7WOwyu8g1B1X+ivzyNV1jG8J8UC y7apFwVs+oCY4vPgNeKIhZmNkifTqJUiUSRk/rM85Sj+45NW1VL5HB+01u2GczqkZsQX I4pBJ2gLmR7Jz1Y/A9s5oGz4EfN4sJqWuGCLlSHgErel5DLsMHVa7gzjqm5iEgX4h2P3 Y0lXrDg5GcZAhQJK02o3i7EvNLdteBM4WM6lztwHxuVWFnPEi+g+PaCRI9cH/+VcSUMB hG/Q== X-Gm-Message-State: ALoCoQkjXd6B3tkLZQhM/siARirESSBr2shZH0eEJPR0dNsMDbpOQ67JHK7reVNBb7SU9lKrUHqT X-Received: by 10.28.47.8 with SMTP id v8mr1596144wmv.30.1447754325397; Tue, 17 Nov 2015 01:58:45 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id hu2sm39026920wjb.21.2015.11.17.01.58.43 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:58:44 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, catalin.marinas@arm.com, will.deacon@arm.com, julien.grall@citrix.com, ard.biesheuvel@linaro.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Cc: xen-devel@lists.xen.org, christoffer.dall@linaro.org, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, hangaohuai@huawei.com Subject: [PATCH 10/13] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI Date: Tue, 17 Nov 2015 17:57:08 +0800 Message-Id: <1447754231-7772-11-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447754231-7772-1-git-send-email-shannon.zhao@linaro.org> References: <1447754231-7772-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 From: Shannon Zhao 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 --- arch/arm64/kernel/acpi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.1.0 -- 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 19de753..7b67426 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -62,10 +62,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 to Xen initial domain that is not + * either /chosen or /hypervisor node. */ if (depth == 1 && (strcmp(uname, "chosen") != 0)) - return 1; + if (!xen_initial_domain() || (strcmp(uname, "hypervisor") != 0)) + return 1; + return 0; } @@ -179,8 +182,9 @@ 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) - * and ACPI has not been force enabled (acpi=force) + * - the device tree is not empty (it has more than just a /chosen node + * or to Xen initial domain it has more than a /chosen node and + * /hypervisor node) and ACPI has not been force enabled (acpi=force) */ if (param_acpi_off || (!param_acpi_force && of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))