Received: by 10.223.176.5 with SMTP id f5csp3422265wra; Mon, 29 Jan 2018 12:58:20 -0800 (PST) X-Google-Smtp-Source: AH8x224PLFNzxUDIrTeXlyDfv6NOThTHkv4r7eFgIPvx7WGWpb+MswT05A1+h4VtF+tn2cQCakiY X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr3215060plg.294.1517259500858; Mon, 29 Jan 2018 12:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517259500; cv=none; d=google.com; s=arc-20160816; b=oN251puHXtwRb9aVa/kikPaRNSYVnHIrnNmX1FCNGvneOGIWD2XR8E1QpflQAl4IsA lFG8sK+CjEXWG3bYGgV7awpj5pKuDtOx0n3txBWFhKJ8Z7XVjeWyO8jhSHqXqSmDw0Hk SE+a8j6pb4+0L5NgOWec8oDNCBb+xtom0ADRb54woM2wHP2Iuob7yQbe/sky2DunNcbi GBbVN3G4+NdsNZmN6m3oVoo7Kx2zH/EOTNGflxamS1OgccXVlN8W4/h2tNX4Ts0++Bvy JjfYDQYYk9is6ciJ0HW8okUNYzo0UJ6pZrNK0IQfCPgOQMhPDLU3XKiuJXF1UBEK0LnT mG/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=P5YKdUcofZXyT+FYnZlxJt5VeOubTTE8HtrGQ5TfLOI=; b=EMd3vm+S4vieNZSGKxF8anofIoT+UQ3qI1sPtHin+CyIsy9KHUsixHv0dNoFOPfJTP PIj2pgN17bMXM6UuF3Bp3u1UPrYwjooE34U6fz1sT04R03l8/Z+eM4Dq7tpniVmatkLr oRTh5Nf4h4+RO7GsPntVnIU2b7picr9U32M3eXSl+FBIeC7Ri1whE9p4Y4IcPwEL0jsC 0QLwyvwTaZ4dmHg8hv5r5pkwtHeowaBCoGIV3eRSpgAGi74lj8wz14S/uQwgdHdamSpj AF2gWmbM2PW8XXHHzr7njSm7Zk+WbbtEIN64KvO6SWdAUv4BBjW3f4X7b33u6LqCT6C4 XwSw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si1258151pgo.495.2018.01.29.12.58.06; Mon, 29 Jan 2018 12:58:20 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751579AbeA2U5p (ORCPT + 99 others); Mon, 29 Jan 2018 15:57:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:54592 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753271AbeA2UJX (ORCPT ); Mon, 29 Jan 2018 15:09:23 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F290B2F12; Mon, 29 Jan 2018 13:02:21 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sudeep Holla , Mian Yousaf Kaukab Subject: [PATCH 4.4 16/74] drivers: base: cacheinfo: fix boot error message when acpi is enabled Date: Mon, 29 Jan 2018 13:56:21 +0100 Message-Id: <20180129123848.326138853@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123847.507563674@linuxfoundation.org> References: <20180129123847.507563674@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudeep Holla commit 55877ef45fbd7f975d078426866b7d1a2435dcc3 upstream. ARM64 enables both CONFIG_OF and CONFIG_ACPI and the firmware can pass both ACPI tables and the device tree. Based on the kernel parameter, one of the two will be chosen. If acpi is enabled, then device tree is not unflattened. Currently ARM64 platforms report: " Failed to find cpu0 device node Unable to detect cache hierarchy from DT for CPU 0 " which is incorrect when booting with ACPI. Also latest ACPI v6.1 has no support for cache properties/hierarchy. This patch adds check for unflattened device tree and also returns as "not supported" if ACPI is runtime enabled. It also removes the reference to DT from the error message as the cache hierarchy can be detected from the firmware(OF/DT/ACPI) Cc: Greg Kroah-Hartman Signed-off-by: Sudeep Holla Signed-off-by: Mian Yousaf Kaukab Signed-off-by: Greg Kroah-Hartman --- drivers/base/cacheinfo.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ +#include #include #include #include @@ -104,12 +105,16 @@ static int cache_shared_cpu_map_setup(un struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cacheinfo *this_leaf, *sib_leaf; unsigned int index; - int ret; + int ret = 0; if (this_cpu_ci->cpu_map_populated) return 0; - ret = cache_setup_of_node(cpu); + if (of_have_populated_dt()) + ret = cache_setup_of_node(cpu); + else if (!acpi_disabled) + /* No cache property/hierarchy support yet in ACPI */ + ret = -ENOTSUPP; if (ret) return ret; @@ -206,8 +211,7 @@ static int detect_cache_attributes(unsig */ ret = cache_shared_cpu_map_setup(cpu); if (ret) { - pr_warn("Unable to detect cache hierarchy from DT for CPU %d\n", - cpu); + pr_warn("Unable to detect cache hierarchy for CPU %d\n", cpu); goto free_ci; } return 0;