From: Sudeep Holla <sudeep.holla@arm.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Tan Xiaojun <tanxiaojun@huawei.com>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 1/2][UPDATE] of: base: add support to get the number of cache levels
Date: Thu, 12 Jan 2017 15:28:20 +0000 [thread overview]
Message-ID: <14f13c99-2fa4-b195-59f8-ddd9ec5b4037@arm.com> (raw)
In-Reply-To: <CAL_Jsq+wawaXeFPnmYw++YMiMzMm+9nSn498Dj7KsGzkfndfog@mail.gmail.com>
On 12/01/17 13:24, Rob Herring wrote:
> On Tue, Jan 10, 2017 at 6:00 AM, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> It is useful to have helper function just to get the number of cache
>> levels for a given logical cpu. This patch adds the support for the
>> same.
>>
>> It will be used on ARM64 platform where the device tree provides the
>> information for the additional non-architected/transparent/external
>> last level caches that are not integrated with the processors.
>>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>> ---
>> drivers/of/base.c | 23 +++++++++++++++++++++++
>> include/linux/of.h | 1 +
>> 2 files changed, 24 insertions(+)
>>
[...]
>> +int of_count_cache_levels(unsigned int cpu)
>> +{
>> + int level = 0;
>> + struct device_node *np = of_cpu_device_node_get(cpu);
>> +
>> + while (np) {
>> + level++;
>
> This will return 1 if you have a cpu node and no cache nodes. Are you
> assuming the cpu has a cache?
>
Ah right, that's completely wrong assumption.
> Perhaps you should just find the last level cache node and then just
> read "cache-level".
>
Yes, sounds better. I will update accordingly. Thanks for the suggestion.
--
Regards,
Sudeep
prev parent reply other threads:[~2017-01-12 15:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 11:41 [PATCH 1/2] " Sudeep Holla
2017-01-10 11:41 ` [PATCH 2/2] arm64: cacheinfo: add support to override cache levels via device tree Sudeep Holla
2017-01-10 11:56 ` [PATCH 1/2] of: base: add support to get the number of cache levels Sudeep Holla
2017-01-10 12:00 ` [PATCH 1/2][UPDATE] " Sudeep Holla
2017-01-12 13:24 ` Rob Herring
2017-01-12 15:28 ` Sudeep Holla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14f13c99-2fa4-b195-59f8-ddd9ec5b4037@arm.com \
--to=sudeep.holla@arm.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=tanxiaojun@huawei.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®