soc: power: npcx: solve an interrupt storm caused by host access.

This CL solves an interrupt storm caused by plenty of host access
messages when system is in S0. It only turns on the host access
interrupt before ec enters sleep and turns it off after leaving
sleep.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
This commit is contained in:
Mulin Chao 2021-03-04 02:37:35 -08:00 committed by Anas Nashif
commit 8c76688b5f
3 changed files with 32 additions and 4 deletions

View file

@ -962,6 +962,16 @@ void npcx_host_init_subs_host_domain(void)
LOG_DBG("Hos sub-modules configurations are done!");
}
void npcx_host_enable_access_interrupt(void)
{
npcx_miwu_irq_enable(&host_sub_cfg.host_acc_wui);
}
void npcx_host_disable_access_interrupt(void)
{
npcx_miwu_irq_disable(&host_sub_cfg.host_acc_wui);
}
int npcx_host_init_subs_core_domain(const struct device *host_bus_dev,
sys_slist_t *callbacks)
{
@ -1057,13 +1067,11 @@ int npcx_host_init_subs_core_domain(const struct device *host_bus_dev,
if (IS_ENABLED(CONFIG_PM)) {
/*
* Configure the host access wake-up event triggered from a host
* transaction on eSPI/LPC bus. No need for callback function.
* transaction on eSPI/LPC bus. Do not enable it here. Or plenty
* of interrupts will jam the system in S0.
*/
npcx_miwu_interrupt_configure(&host_sub_cfg.host_acc_wui,
NPCX_MIWU_MODE_EDGE, NPCX_MIWU_TRIG_HIGH);
/* Enable irq of interrupt-input module */
npcx_miwu_irq_enable(&host_sub_cfg.host_acc_wui);
}
return 0;