Re: [PATCH 0/2] opp: core: add regulators enable and disable

From: Clément Péron
Date: Sat Sep 03 2022 - 16:36:02 EST


Hi Viresh,

On Thu, 21 May 2020 at 14:23, Clément Péron <peron.clem@xxxxxxxxx> wrote:
>
> Hi,
>
> On Fri, 15 May 2020 at 14:00, Clément Péron <peron.clem@xxxxxxxxx> wrote:
> >
> > Hi Viresh,
> >
> > On Fri, 15 May 2020 at 09:57, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> > >
> > > Hi,
> > >
> > > This series reintroduces the usage of regulator_enable/disable() to the
> > > OPP core after the previous attempt was reverted [1] shortly after getting
> > > applied. This time the regulator is enabled only after it is configured
> > > by the OPP core.
> > >
> > > Marek, Kamil and Clément: Can you guys please test this out and report
> > > if this doesn't work as expected ?
> >
> > I have reviewed the patch and it seems fine for my use case.
> > Unfortunately I can't test it until next week.
>
> Ok, before the patch the regulator was released by regulator_late_cleanup() :
> [ 33.756849] vdd-gpu: disabling
>
> Now it works fine and the vdd-gpu is no more disabled.

Today, I compiled my kernel without any program requiring GPU
computing at boot. This makes the dev_pm_opp_set_rate() to never be
called and so the regulator is not enabled before the regulator
framework switches off all the regulators that haven't been enabled.

Unfortunately switching off the GPU regulator makes my board hang..

I'm not sure what is the best approach to fix this.

Is it required that the dev_pm_opp_set_rate() must be called one time
at the GPU driver init?

Panfost already calls devfreq_recommended_opp() and dev_pm_opp_put()
but that doesn't trigger dev_pm_opp_set_rate().

Thanks for your help,
BR,
Clement


>
> Tested-by: Clément Péron <peron.clem@xxxxxxxxx>
>
> Regards,
> Clement
>
> >
> > Acked-by: Clément Péron <peron.clem@xxxxxxxxx>
> >
> > Regards,
> > Clement
> >
> >
> > >
> > > --
> > > viresh
> > >
> > > [1] https://lore.kernel.org/lkml/20191017102758.8104-1-m.szyprowski@xxxxxxxxxxx/
> > >
> > > Kamil Konieczny (1):
> > > opp: core: add regulators enable and disable
> > >
> > > Viresh Kumar (1):
> > > opp: Reorder the code for !target_freq case
> > >
> > > drivers/opp/core.c | 39 ++++++++++++++++++++++++++++++++++-----
> > > drivers/opp/opp.h | 2 ++
> > > 2 files changed, 36 insertions(+), 5 deletions(-)
> > >
> > > --
> > > 2.25.0.rc1.19.g042ed3e048af
> > >