Re: [PATCH] pmdomain: arm: scmi_pm_domain: Initialize state as off

From: Sudeep Holla
Date: Mon Jan 13 2025 - 08:49:30 EST


On Mon, Jan 13, 2025 at 11:37:23AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH] pmdomain: arm: scmi_pm_domain: Initialize
> > state as off
> >
> > On Fri, Jan 10, 2025 at 02:13:46PM +0800, Peng Fan (OSS) wrote:
> > > From: Peng Fan <peng.fan@xxxxxxx>
> > >
> > > Per ARM SCMI Spec DEN0056E, page 16, "The platform may disable a
> > > resource if no agent has requested to use that resource."
> > >
> >
> > True, but ...
> >
> > > Linux Kernel should not rely on a state that it has not requested, so
> > > make state as off during initialization.
> > >
> >
> > IIUC, this was done to avoid any transitions if the bootloader like U-
> > Boot has turned on the resource and OS can just rely on that stay.
>
> But if it is not U-Boot turned it on?

Not sure if I understand what exactly you mean by that.

> Or U-Boot is in a separate agent?
>

No, it will be same as OS for the SCMI platform/agent as they use/share the
same transport. It is hard to distinguish between them.

> > Anyways if the resource is not used by any driver/device in the kernel,
> > won't it be turned off anyways ? What am I missing ?
>
> Because the power domain is ON, kernel will not issue SCMI
> to platform to request it ON when kernel needs this power domain
> on.
>

Yes, but the agent(via bootloader) has already requested the SCMI platform,
so it should be fine. No ?

> But in case when kernel is doing some jobs that needs the
> power domain ON, SCMI platform might power down the
> power domain because kernel agent not request that.
>

See my comment/question above.

--
Regards,
Sudeep