Skip to content

Commit

Permalink
intel_adsp/cavs: power: Fix INTLEVEL value
Browse files Browse the repository at this point in the history
In pm_state_set we can't just call k_cpu_idle() because
this will clear out PS.INTLEVEL. Use k_cpu_atomic_idle instead
since Zephyr's expect interruptions to be locked after pm_state_set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
  • Loading branch information
Flavio Ceolin committed Jan 24, 2024
1 parent 35e1199 commit 228230b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion soc/xtensa/intel_adsp/cavs/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
/* do power down - this function won't return */
power_down_cavs(true, uncache_to_cache(&hpsram_mask[0]));
} else {
k_cpu_idle();
k_cpu_atomic_idle(arch_irq_lock());
}
} else {
__ASSERT(false, "invalid argument - unsupported power state");
Expand All @@ -183,6 +183,12 @@ void pm_state_exit_post_ops(enum pm_state state, uint8_t substate_id)
} else {
__ASSERT(false, "invalid argument - unsupported power state");
}

/**
* We don't have the key used to lock interruptions here.
* Just set PS.INTLEVEL to 0.
*/
__asm__ volatile ("rsil a2, 0");
}
#endif /* CONFIG_PM */

Expand Down

0 comments on commit 228230b

Please sign in to comment.