-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Zephyr power management enhancement plan #89031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@bjarki-andreasen thanks for creating it. From my understanding it is missing creating power domains for internal devices, otherwise those devices won't never know when they are powered off. Other than that is looking great. |
Right! that is step actually step 1 :) |
Ah cool, I thought it was just referring to current ones. |
I am not following this change, this is a pillar and a fundemntal deisgn of runtime device power management. Need more information and details about this change and what does it fix/provide. I think I understand some of the other items, but there need to be some more details and probably we need an overview of the overall power management architecture, why those changes are needed and where we will end up and if anything else is going to follow or if those changes get us where want to be. |
See the parent issue #84049 for details. This issue just describes the how, not the why :) |
Would the busy status indication have any use or be removed along with system managed device PM ? |
do you think it would it be feasible to have a generic driver or at least some common code for the concept of an "internal SOC domain"? BTW, I am new to the power management area of zephyr, but I noticed NXP has this type of thing in a platform DT: zephyr/dts/arm/nxp/nxp_rw6xx_common.dtsi Lines 86 to 90 in 96f51bf
with this binding and this implementation. It seems like it's a power domain representing an SOC system power mode/state instead of a power region in the SOC. Is this wrong / does it need to be changed ? Because on this platform for example there are different domains in the SOC and they are affected differently by the different power states, so having a power domain driver for a power mode seems backwards. Is there some other mechanism to indicate to devices that the power domain will be turned on or off from a system power mode transition, or is it supposed to be the other way around with something like where devices indicate to domains that they are busy and domains block the system power mode transition? |
Given device states now dictate what system states can be entered, the busy flag is not needed. The system simply can't change into a state which would conflict with the state of the device :) |
That is what I'm working towards with step 1. In short, an "internal SOC domain" is simply a power domain which constrains system states, like any device can today :)
The driver for "power-domain" would just be an "empty" device which defines a PM_DEVICE. I'm moving all logic required for power domains up to PM_DEVICE_RUNTIME, so power domain drivers just have to implement PM_DEVICE_ACTION_SUSPEND and PM_DEVICE_ACTION_RESUM. Calling power domain children will be done automatically :)
Exactly this: "is it supposed to be the other way around with something like where devices indicate to domains that they are busy and domains block the system power mode transition?" users call pm_device_runtime_get() on what they need, say an I2C controller, PM_DEVICE_RUNTIME checks if the controller is on one or more power domains, it then resumes the power domains, some of which may prevent specific sleep states from being transitioned to, then resumes the I2C controller itself :) |
Uh oh!
There was an error while loading. Please reload this page.
Introduction
This issue documents and tracks the changes needed to refactor PM device to achieve what is proposed in #84049.
High level steps
Use power domains/devices to dictate system state constraints instead of system state controling power domains/devices PM_DEVICE_POWER_DOMAIN refactor #89372
Replace uses of
PM_DEVICE_SYSTEM_MANAGED
withPM_DEVICE_RUNTIME
in all applications.Remove
PM_DEVICE_SYSTEM_MANAGED
. The system state will not be used to manage devices, this option therefore has no utility, and shall be removed.Remove
pm_device_runtime_enable()
and thezephyr,pm-device-runtime-auto
devicetree property. All devices will be managed byPM_DEVICE_RUNTIME
if enabled, disabling it per device is not a valid pm device configuration.Clean up all device drivers. This includes the following:
pm_device_driver_init()
instead of callingpm_device_runtime_enable()
,pm_device_init_suspended()
etc.note: we will not remove inline calls to self get/put in
can_start()
ori2c_transfer()
at this time.Adjust subsystems and applications (samples) which currently use pm_device_action_run to solely use pm_device_runtime APIs.
Remove inline self get/put calls from device drivers, like often present in
can_start()
/can_stop()
ori2c_transfer()
. These are no longer needed as applications/subsystems are mandated to call these APIs before and after using the device.The text was updated successfully, but these errors were encountered: