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]
Message-ID: <ZbvdRXsvY2qBXApS@shell.armlinux.org.uk>
Date: Thu, 1 Feb 2024 18:04:53 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Stefan Wiehler <stefan.wiehler@...ia.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH RESEND] arm: topology: Fix missing clock-frequency
 property warning

On Thu, Feb 01, 2024 at 04:03:59PM +0100, Stefan Wiehler wrote:
> > Does this mean the /cpus property is like a default for when a CPU node
> > doesn't specify the clock frequency, or does it mean that the /cpus
> > property should only exist when all the values for each CPU are
> > identical and thus the individual CPU node clock frequency should
> > not be specified.
> 
> Good question, the device tree specification in Section 3.7 [1] says:
> 
> > The /cpus node may contain properties that are common across cpu
> nodes. See Section 3.8 for details.
> 
> And in Section 3.8 [2]:
> 
> > 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. This results in a less verbose
> > representation of properties which are identical across all CPUs.
> 
> So I think it is pretty clear that it should only be used for
> common/identical values.

Thanks for the clarification.

As this is DT specified behaviour, I question whether it should be
implemented in arch/arm/kernel/topology.c - what I'm meaning is
a helper such as:

const void *of_get_cpu_property(const struct device_node *node,
				const char *name, int *lenp)
{
	const void *res;

	res = of_get_property(node, name, lenp);
	if (!res) {
		node = of_find_node_by_path("/cpus");
		if (node)
			res = of_get_property(node, name, lenp);
		of_node_put(node);
	}

	return res;
}

?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ