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
Optimize PM structures #39286
Comments
If a driver doesn't support PM, as indicated by setting the pm_control_fn parameter to NULL, no need to manage busy or wakeup state. This also prepares the PM support for issue zephyrproject-rtos#39286, which will allocate PM structures only for the devices that request it. Signed-off-by: Keith Short <keithshort@google.com>
From the Zephyr API meeting 2021-10-12. |
If a driver doesn't support PM, as indicated by setting the pm_control_fn parameter to NULL, no need to manage busy or wakeup state. This also prepares the PM support for issue #39286, which will allocate PM structures only for the devices that request it. Signed-off-by: Keith Short <keithshort@google.com>
@gmarull has opened PR #39397 that I'll refer to as option 4. Option 4 is similar to option 3, in that the PM definitions are broken out into a new macro. However, the |
If a driver doesn't support PM, as indicated by setting the pm_control_fn parameter to NULL, no need to manage busy or wakeup state. This also prepares the PM support for issue zephyrproject-rtos#39286, which will allocate PM structures only for the devices that request it. Signed-off-by: Keith Short <keithshort@google.com>
PR#39397 merged and addresses this issue. |
When a board enables
CONFIG_PM
, theZ_DEVICE_DEFINE
macro allocates an extra 96 (or 100) bytes per device instance. This is true regardless of whether the device instance requires power management notification.There is significant RAM and flash savings if power management is only declared for the device instances that need power management (5000 bytes or more).
There are three possible solutions:
pm_control_fn
parameter isNULL
, and exclude the PM related definitions. PR#39166 implements this approach, but needs some minor cleanup.PM_DISABLED
. Caller's usePM_DISABLED
in place ofNULL
for the pm_control_fn parameter. Draft PR#39256Z_DEFINE_DEFINE
and associated macros. Require device instances that need power management to add TBD macros to enable power management.The text was updated successfully, but these errors were encountered: