devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning
       [not found] ` <dfccb849-67b6-489b-8e83-3df1f9b29877@linaro.org>
@ 2024-02-01 15:03   ` Stefan Wiehler
  2024-02-01 18:04     ` Russell King (Oracle)
  2024-02-02 10:58     ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Wiehler @ 2024-02-01 15:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Russell King
  Cc: linux-arm-kernel, linux-kernel, devicetree

> 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.

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

You are right, clock-frequency is not mentioned neither in arm/cpus.yaml 
nor in any other <arch>/cpus.yaml binding, but the DT spec has it as a 
required property [3]. Should I add clock-frequency to all 
<arch>/cpus.yaml bindings? Only the ARM one explicitly mentions 
following the DT spec.

Kind regards,

Stefan

[1] 
https://devicetree-specification.readthedocs.io/en/latest/chapter3-devicenodes.html#cpus-node-properties
[2] 
https://devicetree-specification.readthedocs.io/en/latest/chapter3-devicenodes.html#cpus-cpu-node-properties
[3] 
https://devicetree-specification.readthedocs.io/en/latest/chapter3-devicenodes.html#general-properties-of-cpus-cpu-nodes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning
  2024-02-01 15:03   ` [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning Stefan Wiehler
@ 2024-02-01 18:04     ` Russell King (Oracle)
  2024-02-02 10:58     ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2024-02-01 18:04 UTC (permalink / raw)
  To: Stefan Wiehler
  Cc: Krzysztof Kozlowski, linux-arm-kernel, linux-kernel, devicetree

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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning
  2024-02-01 15:03   ` [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning Stefan Wiehler
  2024-02-01 18:04     ` Russell King (Oracle)
@ 2024-02-02 10:58     ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-02-02 10:58 UTC (permalink / raw)
  To: Stefan Wiehler, Russell King; +Cc: linux-arm-kernel, linux-kernel, devicetree

On 01/02/2024 16:03, 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.
> 
>> Aren't you adding new property? Is it already documented in the
>> bindings? After a quick look I think this is not documented.
> 
> You are right, clock-frequency is not mentioned neither in arm/cpus.yaml 
> nor in any other <arch>/cpus.yaml binding, but the DT spec has it as a 
> required property [3]. Should I add clock-frequency to all 
> <arch>/cpus.yaml bindings? Only the ARM one explicitly mentions 
> following the DT spec.

It should go to dtschema. dtschema cpu.yaml has it, so you need to
propose such to cpus.yaml, probably you could experiment with:
not:
  - required:
      - clock-frequency
  - patternProperties:
      cpu@....
        - required:
            - clock-frequency

Anyway, you cannot just keep adding some OF properties to the code
without documenting them.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-02 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240201123605.3037829-2-stefan.wiehler@nokia.com>
     [not found] ` <dfccb849-67b6-489b-8e83-3df1f9b29877@linaro.org>
2024-02-01 15:03   ` [PATCH RESEND] arm: topology: Fix missing clock-frequency property warning Stefan Wiehler
2024-02-01 18:04     ` Russell King (Oracle)
2024-02-02 10:58     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).