pm: policy: add check for device busy in policy
Add check for device busy when CONFIG_PM_NEED_ALL_DEVICES_IDLE is set to y because one or more devices may still in busy and causes problem when system go into low power in Intel ISH platform. Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
This commit is contained in:
parent
c0bf310ac8
commit
61ab3a844c
3 changed files with 17 additions and 0 deletions
|
@ -18,4 +18,7 @@ config GDT_RESERVED_NUM_ENTRIES
|
||||||
config REBOOT
|
config REBOOT
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config PM_NEED_ALL_DEVICES_IDLE
|
||||||
|
default y
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -37,6 +37,13 @@ config PM_S2RAM
|
||||||
help
|
help
|
||||||
This option enables suspend-to-RAM (S2RAM).
|
This option enables suspend-to-RAM (S2RAM).
|
||||||
|
|
||||||
|
config PM_NEED_ALL_DEVICES_IDLE
|
||||||
|
bool "System Low Power Mode Needs All Devices Idle"
|
||||||
|
depends on PM_DEVICE && !SMP
|
||||||
|
help
|
||||||
|
When this option is enabled, check that no devices are busy before
|
||||||
|
entering into system low power mode.
|
||||||
|
|
||||||
choice PM_POLICY
|
choice PM_POLICY
|
||||||
prompt "Idle State Power Management Policy"
|
prompt "Idle State Power Management Policy"
|
||||||
default PM_POLICY_DEFAULT
|
default PM_POLICY_DEFAULT
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <zephyr/sys/time_units.h>
|
#include <zephyr/sys/time_units.h>
|
||||||
#include <zephyr/sys/atomic.h>
|
#include <zephyr/sys/atomic.h>
|
||||||
#include <zephyr/toolchain.h>
|
#include <zephyr/toolchain.h>
|
||||||
|
#include <zephyr/pm/device.h>
|
||||||
|
|
||||||
#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state)
|
#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_power_state)
|
||||||
|
|
||||||
|
@ -136,6 +137,12 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks)
|
||||||
uint8_t num_cpu_states;
|
uint8_t num_cpu_states;
|
||||||
const struct pm_state_info *cpu_states;
|
const struct pm_state_info *cpu_states;
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM_NEED_ALL_DEVICES_IDLE
|
||||||
|
if (pm_device_is_any_busy()) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ticks != K_TICKS_FOREVER) {
|
if (ticks != K_TICKS_FOREVER) {
|
||||||
cyc = k_ticks_to_cyc_ceil32(ticks);
|
cyc = k_ticks_to_cyc_ceil32(ticks);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue