[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8296483f-4056-4e64-890f-3f676edb3c3d@spud>
Date: Mon, 27 Mar 2023 15:13:59 +0100
From: Conor Dooley <conor.dooley@...rochip.com>
To: Pierre Gondois <pierre.gondois@....com>
CC: <linux-kernel@...r.kernel.org>, Radu Rendec <rrendec@...hat.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Sudeep Holla <sudeep.holla@....com>,
Akihiko Odaki <akihiko.odaki@...nix.com>,
Palmer Dabbelt <palmer@...osinc.com>,
Gavin Shan <gshan@...hat.com>,
Jeremy Linton <jeremy.linton@....com>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 2/3] cacheinfo: Check cache properties are present in DT
On Mon, Mar 27, 2023 at 01:59:50PM +0200, Pierre Gondois wrote:
> If a Device Tree (DT) is used, the presence of cache properties is
> assumed. Not finding any is not considered. For arm64 platforms,
> cache information can be fetched from the clidr_el1 register.
> Checking whether cache information is available in the DT
> allows to switch to using clidr_el1.
>
> init_of_cache_level()
> \-of_count_cache_leaves()
> will assume there a 2 cache leaves (L1 data/instruction caches), which
> can be different from clidr_el1 information.
>
> cache_setup_of_node() tries to read cache properties in the DT.
> If there are none, this is considered a success. Knowing no
> information was available would allow to switch to using clidr_el1.
>
> Signed-off-by: Pierre Gondois <pierre.gondois@....com>
> +static bool of_check_cache_nodes(struct device_node *np)
> +{
> + struct device_node *next;
> +
> + if (of_property_read_bool(np, "cache-size") ||
> + of_property_read_bool(np, "i-cache-size") ||
> + of_property_read_bool(np, "d-cache-size") ||
> + of_property_read_bool(np, "cache-unified"))
> + return true;
> +
Rob's been purging use of the of_property_read family of functions
recently [1], should this use of_property_present() instead?
Cheers,
Conor.
1 - https://lore.kernel.org/all/?q=Use+of_property_present%28%29+for+testing+DT+property+presence+f%3Arob
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists