aboutsummaryrefslogtreecommitdiff
path: root/module/system_power
diff options
context:
space:
mode:
authorNicola Mazzucato <nicola.mazzucato@arm.com>2019-05-07 17:08:11 +0100
committerronald-cron-arm <39518861+ronald-cron-arm@users.noreply.github.com>2019-06-04 12:00:40 +0200
commit8efc49f4f26a46a2a483577a38ffc6ced44f54de (patch)
treea8f0f0e9e612954e1dc73f02451a34082f8498bb /module/system_power
parent8072cafde75d4e183718e26035d8a79f9c5a0cad (diff)
system_power: Clear pending ISR before enabling
Change-Id: I00bc809a0db98ade3e1344ceb000037debdc6653 Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com>
Diffstat (limited to 'module/system_power')
-rw-r--r--module/system_power/src/mod_system_power.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/module/system_power/src/mod_system_power.c b/module/system_power/src/mod_system_power.c
index fe1da672..8c988571 100644
--- a/module/system_power/src/mod_system_power.c
+++ b/module/system_power/src/mod_system_power.c
@@ -89,14 +89,17 @@ static void ext_ppus_set_state(enum mod_pd_state state)
static int system_power_set_state(fwk_id_t pd_id, unsigned int state)
{
int status;
+ unsigned int soc_wakeup_irq;
status = fwk_module_check_call(pd_id);
if (status != FWK_SUCCESS)
return status;
+ soc_wakeup_irq = system_power_ctx.config->soc_wakeup_irq;
+
switch (state) {
case MOD_PD_STATE_ON:
- fwk_interrupt_disable(system_power_ctx.config->soc_wakeup_irq);
+ fwk_interrupt_disable(soc_wakeup_irq);
system_power_ctx.sys0_api->set_state(
system_power_ctx.config->ppu_sys0_id, MOD_PD_STATE_ON);
@@ -110,17 +113,19 @@ static int system_power_set_state(fwk_id_t pd_id, unsigned int state)
case MOD_SYSTEM_POWER_POWER_STATE_SLEEP0:
ext_ppus_set_state(MOD_PD_STATE_OFF);
+ fwk_interrupt_clear_pending(soc_wakeup_irq);
+
system_power_ctx.sys0_api->set_state(
system_power_ctx.config->ppu_sys0_id, MOD_PD_STATE_OFF);
system_power_ctx.sys0_api->set_state(
system_power_ctx.config->ppu_sys1_id, MOD_PD_STATE_ON);
- fwk_interrupt_enable(system_power_ctx.config->soc_wakeup_irq);
+ fwk_interrupt_enable(soc_wakeup_irq);
break;
case MOD_PD_STATE_OFF:
- fwk_interrupt_disable(system_power_ctx.config->soc_wakeup_irq);
+ fwk_interrupt_disable(soc_wakeup_irq);
ext_ppus_set_state(MOD_PD_STATE_OFF);
system_power_ctx.sys0_api->set_state(