All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>, Peng Fan <peng.fan@nxp.com>,
	"cristian.marussi@arm.com" <cristian.marussi@arm.com>,
	"souvik.chakravarty@arm.com" <souvik.chakravarty@arm.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	"arm-scmi@vger.kernel.org" <arm-scmi@vger.kernel.org>,
	Chuck Cannon <chuck.cannon@nxp.com>
Subject: Re: POWER_DOMAIN_ATTRIBUTES in SCMI
Date: Wed, 19 Feb 2025 00:20:45 +0800	[thread overview]
Message-ID: <20250218162045.GA15753@nxa18884-linux> (raw)
In-Reply-To: <CAKfTPtBd14wM2st62m3tnkQOZgBTUmxpjZXghMVff-Yg7wCVDg@mail.gmail.com>

On Tue, Feb 18, 2025 at 02:57:10PM +0100, Vincent Guittot wrote:
>On Tue, 18 Feb 2025 at 13:03, Peng Fan <peng.fan@oss.nxp.com> wrote:
>>
>> On Tue, Feb 18, 2025 at 10:41:15AM +0000, Sudeep Holla wrote:
>> >On Fri, Feb 14, 2025 at 09:20:27AM +0000, Peng Fan wrote:
>> >> All,
>> >>
>> >> Previously I posted a patch to linux to set all power domains
>> >> with "GENPD_FLAG_ACTIVE_WAKEUP" set in
>> >> drivers/pmdomain/arm/scmi_pm_domain.c
>> >
>> >Yes, I remember ACK-ing that and now I am thinking why 😄.
>> >The description of the flag GENPD_FLAG_ACTIVE_WAKEUP says:
>> >"Instructs genpd to keep the PM domain powered on, in case any of its
>> >attached devices is used in the wakeup path to serve system wakeups."
>> >
>> >Does that mean all the SCMI power domains remain powered on with this
>> >flag ? If so, that sounds wrong to me. I hope it is not the case and it
>> >is effective only if the device attached is wakeup source.
>>
>> Only when the device is setup wakeup source, the genpd framework
>> will take this flag as keeping power domain on.
>>
>> Without this flag, even if the device setup as wakeup source, the
>> device's power domain will still be powered off.
>>
>> >
>> >> But in the end we find that some power domains
>> >> could be in off state while it still could wakeup
>> >> the system. And we have a downstream patch
>> >> +               if (!strcmp(scmi_pd->name, "hsio_top"))
>> >> +                       scmi_pd->genpd.flags = 0;
>> >>
>> >
>> >There you go, so you simply rushed some solution upstream to carry less
>> >patches downstream but this time you got bitten again. Sorry, but I am
>> >seeing a pattern from you here and I don't really like that.
>>
>> I not wanna to argue here.
>> I DO care reputation. If I do something wrong, I will improve.
>>
>> >
>> >> So I am wondering to extend the attributes of SCMI spec,
>> >> Saying In SCMI spec(DEN0056E)
>> >> 4.3.2.5 POWER_DOMAIN_ATTRIBUTES
>> >> Page 44 of 210:
>> >>
>> >> Bit[26]: If set to 1, the power domain could
>> >> wakeup the system with power state
>> >> set as off.
>> >>
>> >
>> >This is not what the above flag is all about. It just instructs genpd
>> >to keep the power domain ON as the device attached to it could be a wakeup
>> >source. They are not one and the same. If the device is marked wakeup in
>> >the DT and it is both wakeup capable and is enabled, it shouldn't request
>> >the power domain to be powered off when suspending. Why is that not
>> >sufficient here ? What am I missing ? I am interested in knowing it as
>> >it is important to fix the issue you are trying to address here.
>>
>> The flag must be set if the power domain needs to keep power on to have
>> the wakeup capability.
>>
>> But in some case, a power domain no need to keep power on and it still
>> have wakeup capability from hardware perspective.
>>
>> For example usb phy in i.MX95, its power domain is off, but it could still
>> wakeup the SoC. But with the GENPD_FLAG_ACTIVE_WAKEUP set, the power domain
>> will not be powered off, so more power consumption in suspended state.
>
>This probably means that the wakeup mechanism is not in the same power
>domain but in another one that is kept on while the device is
>suspended and the main power domain is off. Do you have more details
>about this wakeup source that works with powerdomain being off ?

When power domain is off, some internal registers are retained and
not lost. And there is external always on power rail for always
on hardware logic.

Regards,
Peng

>I vaguely remember some old discussions about inband/outband wakeup
>source settings for devices which enable drivers to specify if the
>wakeup source is in or out of the power domain and if we should keep
>it on or not. But I can't remember the details; Ulf should have more
>details
>
>>
>> So I am requesting extending spec to give agents the information whether
>> the power domain could wakeup HW system in powered off state.
>
>I tend to agree with Sudeep that it doesn't make sense to say that a
>power domain can be off but the powered devices can still wakeup the
>system. It usually means that the wakeup is not powered by the main
>power domain
>
>>
>> >
>> >> This is just an idea in my mind, I not
>> >> write code to verify, just wanna to see
>> >> any comments from your side.
>> >>
>> >
>> >I wonder if we need to revert GENPD_FLAG_ACTIVE_WAKEUP flag enabling on
>> >all SCMI power domains if that is not solving the problem you thought it
>> >would.
>>
>> Revert the flag will cause a power domain not able to wakeup SoC if the
>> power domain needs power state on to have wakeup capability.
>>
>> I am not sure other vendor's SoC design. To i.MX95, without this flag set,
>> the NETC will lose wakeup on LAN capability.
>>
>> Regards,
>> Peng.
>>
>> >
>> >--
>> >Regards,
>> >Sudeep
>> >
>>

      parent reply	other threads:[~2025-02-18 15:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14  9:20 POWER_DOMAIN_ATTRIBUTES in SCMI Peng Fan
2025-02-18 10:41 ` Sudeep Holla
2025-02-18 13:08   ` Peng Fan
2025-02-18 13:57     ` Vincent Guittot
2025-02-18 15:02       ` Ulf Hansson
2025-02-18 15:26         ` Sudeep Holla
2025-02-18 16:31         ` Peng Fan
2025-02-20  2:53           ` Peng Fan
2025-02-20  9:59             ` Souvik Chakravarty
2025-04-08  0:23               ` Kevin Hilman
2025-02-18 16:20       ` Peng Fan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250218162045.GA15753@nxa18884-linux \
    --to=peng.fan@oss.nxp.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=chuck.cannon@nxp.com \
    --cc=cristian.marussi@arm.com \
    --cc=dan.carpenter@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.