lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 1 Feb 2024 14:16:35 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Stefan Wiehler <stefan.wiehler@...ia.com>,
 Russell King <linux@...linux.org.uk>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND] arm: topology: Fix missing clock-frequency
 property warning

On 01/02/2024 13:36, Stefan Wiehler wrote:
> If the clock-frequency property is not set in the cpu node but in the
> parent /cpus node, the following warning is emitted:
> 
>   /cpus/cpu@X missing clock-frequency property
> 
> The devicetree specification in section 3.8 however specifies that
> "properties that have identical values across cpu nodes may be placed in
> the /cpus node instead.  A client program must first examine a specific cpu
> node, but if an expected property is not found then it should look at the
> parent /cpus node."
> 
> Signed-off-by: Stefan Wiehler <stefan.wiehler@...ia.com>
> ---
>  arch/arm/kernel/topology.c | 21 ++++++++++++++++++---
>  1 file changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index ef0058de432b..32fc1c8d9d11 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -85,15 +85,24 @@ static bool cap_from_dt = true;
>  static void __init parse_dt_topology(void)
>  {
>  	const struct cpu_efficiency *cpu_eff;
> -	struct device_node *cn = NULL;
> +	struct device_node *pcn = NULL, *cn = NULL;
>  	unsigned long min_capacity = ULONG_MAX;
>  	unsigned long max_capacity = 0;
>  	unsigned long capacity = 0;
>  	int cpu = 0;
> +	const __be32 *common_rate;
> +	int common_rate_len;
>  
>  	__cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
>  				 GFP_NOWAIT);
>  
> +	pcn = of_find_node_by_path("/cpus");
> +	if (!pcn) {
> +		pr_err("missing CPU root device node\n");
> +		return;
> +	}
> +	common_rate = of_get_property(pcn, "clock-frequency", &common_rate_len);

Aren't you adding new property? Is it already documented in the
bindings? After a quick look I think this is not documented.

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ