Re: [PATCH 0/3] clk: qcom: smd-rpm: Report enable state to framework

Shawn Guo
2021-11-11T09:39:35Z

On Wed, Nov 10, 2021 at 05:48:10AM -0800, Bjorn Andersson wrote:
> > IMHO, properly reporting enable state to framework is definitely the
> > right thing to do, and should have been done from day one.
> >
>
> I always thought is_enabled() should reflect the hardware state - in
> particular for clk_summary. The particular concern being that by
> initializing the is_enabled() state to either true or false, we're
> making an assumption about the hardware state. And if something where to
> do if (enabled) disable (or if (disabled) enable), we might skip a
> critical operation just because we tricked the logic.

That's probably why clk_smd_rpm_handoff() is called. As there is no way
to query RPM for resource state, we send enable request for all RPM
clocks to get hardware and software state in sync.

> So, do you need it for anything other than clk_disable_unused()?

Not critical, but I need it for debugfs clk_summary as well.

Shawn