Re: [PATCH] clk: add sys node to disable unused clk

From: Stephen Boyd
Date: Sun Aug 29 2021 - 01:21:05 EST


Quoting Zhipeng Wang (2021-08-13 02:11:18)
> The normal sequence is that the clock provider registers clk to
> the clock framework, and the clock framework manages the clock resources
> of the system. Clk consumers obtain clk through the clock framework API,
> enable and disable clk.
>
> Not all clk registered through the clock provider will be used
> by the clock consumer, so the clock framework has a function
> late_initcall_sync(clk_disable_unused); disables the unused clk.
>
> Now we modularize the clock provider and some consumers, which will
> cause late_initcall_sync(clk_disable_unused); cannot work properly, so
> increase the sys node.

Sorry, I honestly don't know what's going on here. The commit text is
describing the clk disable unused logic, and then we're adding a sysfs
attribute without documenting it in Documentation/ABI? And there's one
sentence about modular clks not working properly, but I don't know what
is wrong about it besides it is "wrong".

I've been considering ripping out the late initcall to disable unused
clks. It pretty much only leads to problems. If we want to save power,
then maybe we should have clk providers tell us what clks aren't ever
going to be used unless they're referenced in DT or via some clkdev
lookup and only turn the ones off that are in that list if they're on.