All of lore.kernel.org
 help / color / mirror / Atom feed
From: f.fainelli@gmail.com (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: kernel: add support for cpu cache information
Date: Thu, 28 Jan 2016 18:54:11 +0000 (UTC)	[thread overview]
Message-ID: <loom.20160128T191752-889@post.gmane.org> (raw)
In-Reply-To: 1424716091-22914-1-git-send-email-sudeep.holla@arm.com

Sudeep Holla <sudeep.holla <at> arm.com> writes:

> 
> This patch adds support for cacheinfo on ARM platforms.
> 
> On ARMv7, the cache hierarchy can be identified through Cache Level ID
> register(CLIDR) while the cache geometry is provided by Cache Size ID
> register(CCSIDR).
> 
> On architecture versions before ARMv7, CLIDR and CCSIDR is not
> implemented. The cache type register(CTR) provides both cache hierarchy
> and geometry if implemented. For implementations that doesn't support
> CTR, we need to list the probable value of CTR if it was implemented
> along with the cpuid for the sake of simplicity to handle them.
> 
> Since the architecture doesn't provide any way of detecting the cpus
> sharing particular cache, device tree is used fo the same purpose.
> On non-DT platforms, first level caches are per-cpu while higher level
> caches are assumed system-wide.
> 
> This is based on the newly introduced generic cacheinfo infrastructure
> through the commit 246246cbde5e ("drivers: base: support cpu cache
> information interface to userspace via sysfs")
> 
> Signed-off-by: Sudeep Holla <sudeep.holla <at> arm.com>
> Tested-by: Stephen Boyd <sboyd <at> codeaurora.org>
> Cc: Russell King <linux <at> arm.linux.org.uk>
> Cc: Will Deacon <will.deacon <at> arm.com>
> Cc: linux-arm-kernel <at> lists.infradead.org
> ---

It does not appear this patch has been merged yet, I gave it a spin on a
Brahma-B15 based system which has a similar cache hierarchy to the
Cortex-A15, and therefore, has no cache properties listed in Device Tree,
since everything is built-in.

This makes cache_setup_of_node() do the following:

[    1.195477] cache_setup_of_node: this_leaf->level = 1
[    1.200543] cache_setup_of_node: this_leaf->level = 1
[    1.205656] cache_setup_of_node: this_leaf->level = 2
[    1.210721] cache_shared_cpu_map_setup: cache_setup_of_node: -2

Removing the last hunk which does this:

        if (index != cache_leaves(cpu)) /* not all OF nodes populated */
                return -ENOENT;

Allows me to browse the cache properties in sysfs, and they seem to be
consistent with what the hardware features.

Should there be some special casing for CPUs which have a built-in cache?
Did we reach an agreement as to whether these patches are worthy being
merged? ARM64 has it now, and at least, for consistency with other
architectures, it would be nice to have this as well.

Thanks!

      parent reply	other threads:[~2016-01-28 18:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 18:28 [PATCH 1/2] ARM: kernel: add support for cpu cache information Sudeep Holla
2015-02-23 18:28 ` [PATCH 2/2] ARM: kernel: add outer cache support for cacheinfo implementation Sudeep Holla
2015-02-23 19:36 ` [PATCH 1/2] ARM: kernel: add support for cpu cache information Russell King - ARM Linux
2015-02-24 18:23   ` Sudeep Holla
2016-01-28 18:54 ` Florian Fainelli [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=loom.20160128T191752-889@post.gmane.org \
    --to=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.