-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
pm: review post sleep wake up application notification scheduling #32474
Comments
@ceolin, @pabigot, @nashif as discussed yesterday. Regarding the Though, if it is confirmed that wake up from sleep always occurs via IRQ ( |
@erwango I think you are correct and notification should only be sent after SoC post ops, have submitted a pr changing it. Another thing that I was wondering about is, currently we send notification about entering in a power state before device pm and if a device fails we send another notification about exiting a power state without never really have changed. Thinking that we should send notification after device PM, just before ask SoC to go to a power state. |
I end up removing the commit implementing it because I found a problem with that. Usually SoCs restore IRQ in the post operations callback and it can cause the idle thread be scheduled out and consequently not sending the notification about leaving a state in the right time. I currently don't have a better answer about how to fix this, if it is define that SoC should not restore IRQ and let it to the kernel or if we should use a work queue to send this notification. |
Fixed in 87c6311 |
In sleep states exit treatment functions (
pm_system_resume
,pm_policy_mgr
), we can see that application notification (pm_state_notify
) is called before SoC level post wake up operations (pm_power_state_exit_post_ops
).This could lead to several issues as we don't know what treatment applications may do on such notification, but this should be noted that SoC is potentially not fully waken up (and potentially devices neither). So starting treamtents at this steps can lead to undefined behavior.
Maybe there were reasons to implement appplications notifications this way, but at least PM should provide the option to swap the operations order so that application is notified about sleep state exit only when SoC and devices are fully ready to treat application demands.
The text was updated successfully, but these errors were encountered: