-
Notifications
You must be signed in to change notification settings - Fork 2.1k
sys/pm_layered: extend documentation #21670
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
base: master
Are you sure you want to change the base?
Conversation
While the existing documentation already contains all the info in a very dense form, there are still often confusion on what `pm_layered` does and how to correctly use and integrate with it. Maybe extending the documentation does help to make things more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two smal things because I'm really tired.
Also I thought about whether this wouldn't be more at home in a doc.md
file.
Co-authored-by: crasbe <[email protected]>
Some of the current implementations don't comply with this. I'm not sure whether the scope of these changes is to document the current state, or what it ought to be and fixes will follow up. For example: * @ref pm_set must ignore any power mode that does not have full RAM retention,
* as losing data whenever no (non-idle) thread is runnable is not acceptable. samd5x may very well enter backup mode through pm_layered and lose RAM contents, save for the backup region. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc helped me. But if it is all about clocks, an API like <clock_domain>_acquire()
and <clock_domain>_release()
calling the pm
API would have been more clear to me from the beginning.
Co-authored-by: fabian18 <[email protected]>
I do agree. But there might be an MCU that allows power management not only by enabling different clock domains, but also other power consuming functions such as e.g. DMA access by peripherals (which would then need to be blocked when setting up DMA transfers and unblocked when all expected DMA transfers concluded). |
I raised this issue in the Matrix chat to quickly get feedback whether my understanding here is correct or not and got supporting emoji reactions from fellow long term contributors, and nobody disagreed. But this shows that indeed some more detail in the doc would be helpful. It would also be nice to have some explicit |
In that case I guess the MCU implementation should also provide Or, is this supposed to be handled implicitly by acquiring/releasing the MCU-specific driver instance, which in turns blocks that power mode? E.g. ztimer would |
It is expected the e.g. A call to However, ztimer does have a work around to block at that level power modes, which was faster for getting ztimer in than having to go through the code base and fix all the bugs in there. Someone(TM) really should go through the |
Contribution description
While the existing documentation already contains all the info in a very dense form, there are still often confusion on what
pm_layered
does and how to correctly use and integrate with it.Maybe extending the documentation does help to make things more clear.
Testing procedure
Read the new documentation and compare it to the old one. Things should be easier to understand with the new doc.
Issues/PRs references
None