Received: by 10.223.176.5 with SMTP id f5csp3356935wra; Mon, 29 Jan 2018 12:08:21 -0800 (PST) X-Google-Smtp-Source: AH8x225vauHW+Dl+IL6wTbRrelp+x4991vsfMi5KHFRw/CtgySNesd57erRPLedBLDeI48RAFq3Z X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr10102717pld.385.1517256501836; Mon, 29 Jan 2018 12:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517256501; cv=none; d=google.com; s=arc-20160816; b=kNJjmTMrJa7SuNzkDtzrhlhTi0sntYO+X40LwaYqbs4mu/zlR7BZCvinBasAVp6gS0 90R5L+r/dK6ct9FMzwfCERvYNholZCp5CwxGhXJhvEJhAKH5t9/WjLaLY29zzGwGJj2N P5sYG9mM+r2+ZSgqqyy16hlcnhLbG2gc4hDVm709XPST3JlpzL77afKuAmEcg9t+D7Qo NLVNa7q+FYAyAQVrVL97ExYEr4pFvMRYZAA2a7WWwLd7IvTg3r8RRgsD8loz2+0qJnbp bkYsrEyNx6CuI1LisExAz2Vrv6FGMagoo9B15A0URqzqzf+PDIe6BoUs/Lt4XdGoIz9k 4aLQ== 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=v7K1siisStpklYsYNdiEZ0GYW80fE6LMt9XuiZjyCGM=; b=V6s0x3anQfpstpkGS19uK5k1iBfays2dVcvHt5Mzbkfu8St/cnllYhnHuZ6A/KE8vr hG85b2cc3wBLRR7TEXl+2pb7rs1BUUTibrQPvbN5IXz8S1jCUT9u/lvF/UyTaUa74W5m HIDwOPEnBA0BS0YzAo2AtVba1AvdxFZR2MIaSKIaG4upVaiPzo7hilK/Gpj9f9eE+mX2 tC0fYbWpC9HGHSI18d8DfRSQaSs3h+U6N52PYJnrrOcmKa65zZngE7zzZVR12ipoMVG7 teRVERO/jFnkhiz/7i7DeZo6H/k1eQuvExt8G4E+1yR/oE9lOasebUlIPRUduNSZZ7Qq Ksrg== 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 16si4144307pfr.39.2018.01.29.12.08.07; Mon, 29 Jan 2018 12:08:21 -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 S1752847AbeA2UG7 (ORCPT + 99 others); Mon, 29 Jan 2018 15:06:59 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49694 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbeA2UG4 (ORCPT ); Mon, 29 Jan 2018 15:06:56 -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 042FB2F5C; Mon, 29 Jan 2018 13:04:27 +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.9 12/66] drivers: base: cacheinfo: fix boot error message when acpi is enabled Date: Mon, 29 Jan 2018 13:56:36 +0100 Message-Id: <20180129123840.482706833@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123839.842860149@linuxfoundation.org> References: <20180129123839.842860149@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.9-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;