[PATCH] clk: Dont return error when assigned-clocks is empty or missing

Michal Simek michal.simek at amd.com
Tue Jul 11 16:55:33 CEST 2023



On 7/11/23 16:28, Sean Anderson wrote:
> On 7/11/23 10:20, Michal Simek wrote:
>> Hi Sean,
>>
>> On 7/11/23 15:40, Sean Anderson wrote:
>>> On 7/11/23 05:51, Ashok Reddy Soma wrote:
>>>> There is a chance that assigned-clock-rates is given and assigned-clocks
>>>> could be empty. Dont return error in that case, because the probe of the
>>>> corresponding driver will not be called at all if this fails.
>>>> Better to continue to look for it and return 0.
>>>
>>> No, this is an error in the device tree. assigned-clock-rates depends on
>>> assigned-clocks, so you must provide the latter if the former is present.
>>
>> We were also checking it and in the Linux kernel it is handle like this.
>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/clk-conf.c#n95
>>
>> It means you can have rate assigned but not assigned-clocks property.
>>
>> And yes in working case both should be present to work properly.
> 
> What is the use-case for this? It will not pass schema checking [1] anyway.
> 
> --Sean
> 
> [1] 
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/clock/clock.yaml

If you check your DT against schema. No doubt how correct behavior should be.

It is just aligning behavior with Linux kernel if user messes up DT.

Thanks,
Michal


More information about the U-Boot mailing list