mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-02 07:32:38 +00:00
z_power_soc_deep_sleep() is called with interrupt locked already so restoring BASEPRI is pointless here, as it would only allow exceptions afterwards. The situation is complicated by the fact that kernel/idle.c:idle() only locks interrupt without unlocking which means the BASEBRI at entry of z_power_soc_deep_sleep() is already set to allow exceptions only but not lower priority interrupts like timer. So when, e.g. timer, interrupt fires, the SoC would come out of deep sleep but the waking interrupts are never delivered since they are masked, and idle() will try to sleep again. And now it gets into a loop of going into deep sleep briefly and waking up immediately and it goes on and on. The solution is not to restore BASEPRI and simply leave it at zero. This is a workaround as a proper fix would involve invasion changes to the PM subsystem. Also, _sys_pm_power_state_exit_post_ops() is not being called when deep sleep is involved, so PRIMASK needs to be reset after coming out of deep sleep. Fixes #23274 Signed-off-by: Daniel Leung <daniel.leung@intel.com> |
||
---|---|---|
.. | ||
arm | ||
atmel_sam | ||
atmel_sam0 | ||
bcm_vk | ||
common/cortex_m | ||
cypress | ||
microchip_mec | ||
nordic_nrf | ||
nxp_imx | ||
nxp_kinetis | ||
nxp_lpc | ||
qemu_cortex_a53 | ||
silabs_exx32 | ||
st_stm32 | ||
ti_lm3s6965 | ||
ti_simplelink | ||
xilinx_zynqmp | ||
CMakeLists.txt | ||
Kconfig |