Re: [PATCH RFT 01/20] clk: qcom: smd-rpm: Add .is_enabled hook

From: Dmitry Baryshkov
Date: Sun Mar 05 2023 - 19:27:18 EST


On 06/03/2023 02:21, Dmitry Baryshkov wrote:
On Sat, 4 Mar 2023 at 15:27, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> wrote:

From: Shawn Guo <shawn.guo@xxxxxxxxxx>

The RPM clock enabling state can be found with 'enabled' in struct
clk_smd_rpm. Add .is_enabled hook so that clk_summary in debugfs can
show a correct enabling state for RPM clocks.

There is a small problem with this patch: now if the bootloader leaves
a clock enabled for some reason and there are no Linux users for that
clock, clk_disable_unused_subtree() will consider this clock disabled
and will not disable the clock on its own.
And at this stage of smd-rpm platforms support I think we better off
finding missing clock consumers rather than depending on the
bootloader for some of the setup.

Argh. And then I understood that without the patch clk_core_is_enabled will shortcut to core->enable_count, which also means that the clock will be skipped.

But now I have another question: since r->enabled follows core->enabled_count, can we get rid of r->enabled and switch to core->enable_count? This might mean adding clk_software_is_enabled() function for your patch.

--
With best wishes
Dmitry