zephyr/soc/arm/microchip_mec/mec1501
Daniel Leung b935903543 soc: mec1501: modifies interrupt restoration after deep sleep
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>
2020-04-10 07:48:33 -04:00
..
CMakeLists.txt soc : mec1501 : Deep and light sleep example 2019-12-09 11:57:03 -05:00
device_power.c soc: mec1501: wait for UART FIFO clear before deep sleep 2020-02-28 20:18:13 +02:00
device_power.h soc : mec1501 : Deep and light sleep example 2019-12-09 11:57:03 -05:00
dts_fixup.h soc: microchip_mec: Convert to new DT_INST macros 2020-03-26 16:31:52 -05:00
Kconfig.defconfig.mec1501hsz soc: arm: microchip: Expose PECI feature on MEC1501 SoC 2020-03-13 18:53:04 +02:00
Kconfig.defconfig.series kconfig: Replace defconfig singe-symbol 'if's with 'depends on' 2020-02-12 10:32:13 -06:00
Kconfig.series kconfig: Remove assignments to CONFIG_<arch> syms and hide them 2020-02-08 00:50:08 -06:00
Kconfig.soc soc : mec1501 : Deep and light sleep example 2019-12-09 11:57:03 -05:00
linker.ld arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
power.c soc: mec1501: modifies interrupt restoration after deep sleep 2020-04-10 07:48:33 -04:00
soc.c arch: arm: Move ARM code to AArch32 sub-directory 2019-12-20 11:40:59 -05:00
soc.h soc: microchip_mec: Add header for extracting eSPI data 2019-11-20 15:02:08 -05:00