module/power_domain: Only respond to `SYSTEM_SHUTDOWN` if necessary
Created by: leandro-arm
Upon receiving a PD_EVENT_IDX_SYSTEM_SHUTDOWN event, check_and_notify_system_shutdown() checks for subscribers to the MOD_PD_NOTIFICATION_IDX_PRE_SHUTDOWN notification and notifies them. If there are subscribers, the is_delayed_response flag of the PD_EVENT_IDX_SYSTEM_SHUTDOWN event is set in order to wait for the subscribers answer. However, this message does not require an answer as the response_requested field of this event is never set.
Check that:
- The
response_requestedflag is set in theeventinput parameter in order to only answer if a response was requested. -
mod_pd_ctx.system_shutdown.cookiewas set if a delayed answer is expected. The cookie and theongoingare then reset.