Re: [PATCH v2 4/6] PM: domains: Store the closest hrtimer event of the domain CPUs

From: Bjorn Andersson
Date: Wed Jun 29 2022 - 00:26:44 EST


On Thu 19 May 07:56 CDT 2022, Ulf Hansson wrote:

> On Wed, 11 May 2022 at 15:17, Maulik Shah <quic_mkshah@xxxxxxxxxxx> wrote:
> >
> > The arch timer can not wake up the Qualcomm Technologies, Inc. (QTI)
> > SoCs when the deepest CPUidle modes results in the SoC also to enter
> > the low power mode.
> >
> > RSC is part of CPU subsystem and APSS rsc device is attached to cluster
> > power domain. RSC has to setup next hrtimer wakeup in CONTROL_TCS which
> > can wakeup the SoC from deepest low power states. The CONTROL_TCS does
> > this by writing next wakeup in always on domain timer when the SoC is
> > entering the low power state.
> >
> > Add dev_pm_genpd_get_next_hrtimer() to get the genpd wakeup time.
> >
> > Signed-off-by: Maulik Shah <quic_mkshah@xxxxxxxxxxx>
> > ---
> > drivers/base/power/domain.c | 24 ++++++++++++++++++++++++
> > drivers/base/power/domain_governor.c | 1 +
> > include/linux/pm_domain.h | 7 +++++++
> > 3 files changed, 32 insertions(+)
> >
> > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> > index 18cd796..f0d70d0 100644
> > --- a/drivers/base/power/domain.c
> > +++ b/drivers/base/power/domain.c
> > @@ -487,6 +487,29 @@ void dev_pm_genpd_set_next_wakeup(struct device *dev, ktime_t next)
> > }
> > EXPORT_SYMBOL_GPL(dev_pm_genpd_set_next_wakeup);
> >
> > +/**
> > + * dev_pm_genpd_get_next_hrtimer - Return genpd domain next_hrtimer.
> > + *
> > + * @dev: Device to handle
> > + *
> > + * Returns the aggregated domain wakeup time for CPU PM domain
> > + * when all the subdomains are off.
>
> To further clarify when this function should be used, I think that we
> should state that it should typically be called from a consumer of a
> genpd on/off-notifier at GENPD_NOTIFY_PRE_OFF. This also means that
> the genpd's lock is being held across the function.
>

Maulik, it seems the only things remaining for this series it resolve
these three comments. Looking forward to be able to merge the next
revision.

Regards,
Bjorn