Received: by 10.223.176.46 with SMTP id f43csp3383560wra; Mon, 22 Jan 2018 13:15:59 -0800 (PST) X-Google-Smtp-Source: AH8x226PmGXT2hSZGmY8ISpYi847F4OQ0xTAix0AkrEoXkgkRvzb7CWyuJC6nCI2S3odT1zNDza3 X-Received: by 10.107.25.195 with SMTP id 186mr406374ioz.200.1516655758857; Mon, 22 Jan 2018 13:15:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516655758; cv=none; d=google.com; s=arc-20160816; b=ubj2ghd0IWTasciSiDDD3YLfgBIFKS0gIQEUqtLamyrpruEKoAnjc+WxcX/5Q3YEIX GIpQ475DCcxazFFuZV8PWs5oKsTqPOJcoda5fmYCPBETsrKIwK4zs/YKWtHEshZGx8uS 1ei9TDy6DZGeDsBfI02xvcAIjEbPWSHeY/uur7wFM4kq5DBjLEUEUmuDYOfCz3vRx+TF 6/t57sVYFqRr8eaY/OYQ8/1Y1B8+CUEzlcdEi2WdgG8ax+dGqdVU3rO3h2CQVmHCXbTT InwkrfkBuBf7DFC0nqKc6Upa4K4X4Lr25D74s8PXOyilCK2ULapDCWiUwdnDBcI36oAq jbsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=graxB1z2nYS3Ukjs2Qsloufj+SCu3AOjecZtWuFckGI=; b=ED/aEZVH6SaUSwGXPCkfaXsb3MOaumd8v8xs/yY4bcWyoX9OAvkTkZke/CC8LbEarP 2DcFeXIWqJshwFVgRuMEysJno4KeGqas+5zNLuWuNlhtBQxzf5qE8CwTBkDgE/fjKlp7 b/RfJ9OmTGQwXaOHWsNIf3UF+HjtA/5DUojof1eJxJ/QW5B35SxT0LMAjZb9KawiX7hJ LfRAxddK+XvxY/qaXegltzPXkb1puvNKvdxnrjWJ5LIWZbngRHez5veyJkrseB4kX7kL nzV/fhjKucyTXSHS5mPrX4nNvml+4zi+GmKhbiD/2VWNr8ecO/h4DokwG5HfOOroARMD EVHQ== 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 h83si13815714ioi.78.2018.01.22.13.15.44; Mon, 22 Jan 2018 13:15:58 -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 S1751200AbeAVVOl (ORCPT + 99 others); Mon, 22 Jan 2018 16:14:41 -0500 Received: from foss.arm.com ([217.140.101.70]:35406 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbeAVVOk (ORCPT ); Mon, 22 Jan 2018 16:14:40 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8B9A80D; Mon, 22 Jan 2018 13:14:39 -0800 (PST) Received: from [192.168.100.241] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7441F3F53D; Mon, 22 Jan 2018 13:14:38 -0800 (PST) Subject: Re: [PATCH v6 07/12] drivers: base cacheinfo: Add support for ACPI based firmware tables To: Greg KH Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, will.deacon@arm.com, catalin.marinas@arm.com, viresh.kumar@linaro.org, mark.rutland@arm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, jhugo@codeaurora.org, wangxiongfeng2@huawei.com, Jonathan.Zhang@cavium.com, ahs3@redhat.com, Jayachandran.Nair@cavium.com, austinwc@codeaurora.org, lenb@kernel.org, vkilari@codeaurora.org, morten.rasmussen@arm.com References: <20180113005920.28658-1-jeremy.linton@arm.com> <20180113005920.28658-8-jeremy.linton@arm.com> <20180122155022.GA7714@kroah.com> From: Jeremy Linton Message-ID: <1485ab78-4b43-b703-ca48-4e2cb2059e51@arm.com> Date: Mon, 22 Jan 2018 15:14:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180122155022.GA7714@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for taking a look at this. On 01/22/2018 09:50 AM, Greg KH wrote: > On Fri, Jan 12, 2018 at 06:59:15PM -0600, Jeremy Linton wrote: >> Add a entry to to struct cacheinfo to maintain a reference to the PPTT >> node which can be used to match identical caches across cores. Also >> stub out cache_setup_acpi() so that individual architectures can >> enable ACPI topology parsing. >> >> Signed-off-by: Jeremy Linton >> --- >> drivers/acpi/pptt.c | 1 + >> drivers/base/cacheinfo.c | 20 +++++++++++++------- >> include/linux/cacheinfo.h | 9 +++++++++ >> 3 files changed, 23 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c >> index 2c4b3ed862a8..4f5ab19c3a08 100644 >> --- a/drivers/acpi/pptt.c >> +++ b/drivers/acpi/pptt.c >> @@ -329,6 +329,7 @@ static void update_cache_properties(struct cacheinfo *this_leaf, >> { >> int valid_flags = 0; >> >> + this_leaf->fw_unique = cpu_node; >> if (found_cache->flags & ACPI_PPTT_SIZE_PROPERTY_VALID) { >> this_leaf->size = found_cache->size; >> valid_flags++; >> diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c >> index 217aa90fb036..ee51e33cc37c 100644 >> --- a/drivers/base/cacheinfo.c >> +++ b/drivers/base/cacheinfo.c >> @@ -208,16 +208,16 @@ static int cache_setup_of_node(unsigned int cpu) >> >> if (index != cache_leaves(cpu)) /* not all OF nodes populated */ >> return -ENOENT; >> - >> return 0; >> } >> + > > Whitespace changes not needed for this patch :( Sure. > > >> #else >> static inline int cache_setup_of_node(unsigned int cpu) { return 0; } >> static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, >> struct cacheinfo *sib_leaf) >> { >> /* >> - * For non-DT systems, assume unique level 1 cache, system-wide >> + * For non-DT/ACPI systems, assume unique level 1 caches, system-wide >> * shared caches for all other levels. This will be used only if >> * arch specific code has not populated shared_cpu_map >> */ >> @@ -225,6 +225,11 @@ static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf, >> } >> #endif >> >> +int __weak cache_setup_acpi(unsigned int cpu) >> +{ >> + return -ENOTSUPP; >> +} >> + >> static int cache_shared_cpu_map_setup(unsigned int cpu) >> { >> struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); >> @@ -235,11 +240,11 @@ static int cache_shared_cpu_map_setup(unsigned int cpu) >> if (this_cpu_ci->cpu_map_populated) >> return 0; >> >> - if (of_have_populated_dt()) >> + if (!acpi_disabled) >> + ret = cache_setup_acpi(cpu); > > Why does acpi go first? :) This sounds like a joke i heard... OTOH, given that we have machines with both ACPI and DT tables, it seemed a little clearer and a little more robust to code that so that if ACPI is enabled to prefer it over DT information. As long as the routines which set of of_root are protected by if (acpi_disabled) checks it should be safe to do it either way. > >> + else 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; >> >> +int acpi_find_last_cache_level(unsigned int cpu) >> +{ >> + /*ACPI kernels should be built with PPTT support*/ > > Here are some extra ' ' characters, you need them... Oh ok, thanks! :)