Received: by 10.223.176.46 with SMTP id f43csp161812wra; Fri, 19 Jan 2018 15:29:47 -0800 (PST) X-Google-Smtp-Source: AH8x2266smf/hBRX2BLfwH6dgkb10LyO/obxho8v8mTolzn5WyAuAABKdbdsT6hAQ9frfCKxdALc X-Received: by 2002:a17:902:3225:: with SMTP id y34-v6mr61461plb.399.1516404587651; Fri, 19 Jan 2018 15:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516404587; cv=none; d=google.com; s=arc-20160816; b=SNbIE6GGCgiEhoPMl4LG1jgc0o7c0JuhJg93sTV8cLI7Qw3MAslYcB2wFtLByBtRIi rIVqhSvmLoOe7w1tmP6xxe5U9qjpIb+gftHRbA1YUgBQaIcHDTKbjJstBgZlNomGfOPt VptD3zj0Tcu51VchIXL8sYqi22e44Aw/8PjY8fdaq4hRfwyojs2wwz5uZxVxQNcGnSzD HH/WYHrAJiC7EHraue34xDGBO2orDgNAeiQzakH2MzK7e/95YMR+fl9t9bXzy/vLynNE uUJ3nhJTyCFbSfRHUHZxKNhD4vleO316sJGHQkscl9v18SHNYlS5Ybi3sdJqCGB82rNJ 6G3w== 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=eqng5fHHx5SLI/j72357qciwGtMhyNttJf2JQCo/RB4=; b=dXO7NpXLyAsTHuxv1mIG4Tpdseu/P9xUMxzgDTJPZhJi3w50DV0X7Fv/By+17K9T22 NxA37MrdSnFsuCFj4YAoWMwFme8uop6zt/KhLTfBSfr8BBms5GOu5o7Kd3NvbIfS7ymR aKCkTnCAlDJAMUaIoj4Xr4uDSsN0QfX/35eDU0H6kmn5TXTCwIswZiDGgK01YlaBed7G +HSx+8mBqnn/D4No2jPQkoCQL5jPfaDVRz/gq6X7e4gYt38U6c0J2QfpM+hOJx6lxtB5 1QgDpn049yT4X8/WkjPmfSRFQRQr8R4py94y9pIex97hs7pYun9Hdhde/xsIB9zViAIJ uJkQ== 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 j2-v6si1191763plk.264.2018.01.19.15.29.32; Fri, 19 Jan 2018 15:29:47 -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 S1755899AbeASX1d (ORCPT + 99 others); Fri, 19 Jan 2018 18:27:33 -0500 Received: from foss.arm.com ([217.140.101.70]:44274 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752938AbeASX1X (ORCPT ); Fri, 19 Jan 2018 18:27:23 -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 505CE1435; Fri, 19 Jan 2018 15:27:23 -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 00D2F3F557; Fri, 19 Jan 2018 15:27:21 -0800 (PST) Subject: Re: [PATCH v6 02/12] drivers: base: cacheinfo: setup DT cache properties early To: Sudeep Holla Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, rjw@rjwysocki.net, will.deacon@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, 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, Palmer Dabbelt , Albert Ou References: <20180113005920.28658-1-jeremy.linton@arm.com> <20180113005920.28658-3-jeremy.linton@arm.com> <20180115123338.GB5473@e107155-lin> <65f78c99-8b86-0098-7ced-899840a4bf16@arm.com> <15884ccc-2cfb-da91-5844-369d8237175d@arm.com> <05a8b375-70c4-34d4-6cde-8dd4cd62c10b@arm.com> From: Jeremy Linton Message-ID: <6627a9ef-8d62-3cdf-dbea-390770991f30@arm.com> Date: Fri, 19 Jan 2018 17:27:21 -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: <05a8b375-70c4-34d4-6cde-8dd4cd62c10b@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 01/18/2018 04:14 AM, Sudeep Holla wrote: > > > On 17/01/18 18:51, Jeremy Linton wrote: >> Hi, >> >> On 01/17/2018 12:20 PM, Sudeep Holla wrote: >>> >>> >>> On 16/01/18 21:07, Jeremy Linton wrote: >>>> Hi, >>>> >>>> On 01/15/2018 06:33 AM, Sudeep Holla wrote: >>>>> On Fri, Jan 12, 2018 at 06:59:10PM -0600, Jeremy Linton wrote: >>>>>> The original intent in cacheinfo was that an architecture >>>>>> specific populate_cache_leaves() would probe the hardware >>>>>> and then cache_shared_cpu_map_setup() and >>>>>> cache_override_properties() would provide firmware help to >>>>>> extend/expand upon what was probed. Arm64 was really >>>>>> the only architecture that was working this way, and >>>>>> with the removal of most of the hardware probing logic it >>>>>> became clear that it was possible to simplify the logic a bit. >>>>>> >>>>>> This patch combines the walk of the DT nodes with the >>>>>> code updating the cache size/line_size and nr_sets. >>>>>> cache_override_properties() (which was DT specific) is >>>>>> then removed. The result is that cacheinfo.of_node is >>>>>> no longer used as a temporary place to hold DT references >>>>>> for future calls that update cache properties. That change >>>>>> helps to clarify its one remaining use (matching >>>>>> cacheinfo nodes that represent shared caches) which >>>>>> will be used by the ACPI/PPTT code in the following patches. >>>>>> >>>>>> Cc: Palmer Dabbelt >>>>>> Cc: Albert Ou >>>>>> Signed-off-by: Jeremy Linton >>>>>> --- >>>>>>    arch/riscv/kernel/cacheinfo.c |  1 + >>>>>>    drivers/base/cacheinfo.c      | 65 >>>>>> +++++++++++++++++++------------------------ >>>>>>    include/linux/cacheinfo.h     |  1 + >>>>>>    3 files changed, 31 insertions(+), 36 deletions(-) >>>>>> >>>>>> diff --git a/arch/riscv/kernel/cacheinfo.c >>>>>> b/arch/riscv/kernel/cacheinfo.c >>>>>> index 10ed2749e246..6f4500233cf8 100644 >>>>>> --- a/arch/riscv/kernel/cacheinfo.c >>>>>> +++ b/arch/riscv/kernel/cacheinfo.c >>>>>> @@ -30,6 +30,7 @@ static void ci_leaf_init(struct cacheinfo >>>>>> *this_leaf, >>>>>>            CACHE_WRITE_BACK >>>>>>            | CACHE_READ_ALLOCATE >>>>>>            | CACHE_WRITE_ALLOCATE; >>>>>> +    cache_of_set_props(this_leaf, node); >>>>> >>>>> This may be necessary but can it be done as later patch ? So far >>>>> nothing >>>>> is added that may break riscv IIUC. >>>> >>>> Well I think you have a bisection issue where the additional information >>>> will disappear between this patch and wherever we put this code back in. >>>> >>> >>> Hmm, I am sorry but I fail to see the issue. Before this change, >>> populate_cache_leaves just populated the info as per ci_leaf_init in >>> arch/riscv/kernel/cacheinfo.c and cache_override_properties used to fill >>> the remaining. >>> >>> After this patch, the same is achieved in cache_shared_cpu_map_setup. >>> >>> In both case, it was by the end of detect_cache_attributes, so I see no >>> issue. >>> >> >> >> Hi, >> >> I must be misunderstanding something. >> > > Looks like I was missing to understand something :) > >> AFAIK, The code in cache_setup_of_node() won't call cache_of_set_props() >> because it returns when there is an existing of_node (fw_unique) created >> by the riscv populate_cache_leaves(). That's why I'm making the direct >> call here. If we fail to get that change in place before >> cache_override_properties() is removed then the fields not set by the >> riscv code (size/etc) will be missing. > > Indeed. I am trying to avoid use of cache_of_set_props outside. > How about skipping setting up of fw_unique in ci_leaf_init instead ? > I've been thinking about this, but I'm hesitant because I don't have a good test platform for this code. Plus, I'm not 100% sure that the results are the same (is it possible that the platform setup node isn't the same as the one the the common code would find?). I also think I'm getting a little off topic with these patches in relation to what the core goal is (adding PPTT parsing).