Skip to content

Commit

Permalink
intel_adsp/ace: power: Use MMU reinit API on core context restore
Browse files Browse the repository at this point in the history
Replace the MMU initialization call with the new MMU re-initialization
API during the core context restore process in the ACE power management
code.

The previous code was directly calling `xtensa_mmu_init()` upon
restoring the core context, which is not appropriate when the MMU
context may have been preserved during low-power states. The new
`xtensa_mmu_reinit()` API is designed to re-establish the MMU context
without overwriting the existing page table, ensuring that any runtime
changes to the MMU configuration are retained.

Changes made in this patch:
- Removed the call to `xtensa_mmu_init()` from the
  `_restore_core_context()` function.
- Added a call to `xtensa_mmu_reinit()` after restoring the
  miscellaneous registers.

This update aligns the ACE power management code with the correct MMU
handling procedures when recovering from low-power states, as per the
recent changes in the Xtensa MMU support.

Signed-off-by: Tomasz Leman <[email protected]>
  • Loading branch information
tmleman authored and nashif committed Jun 25, 2024
1 parent a983a5e commit a383504
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions soc/intel/intel_adsp/ace/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ static ALWAYS_INLINE void _restore_core_context(void)
{
uint32_t core_id = arch_proc_id();

#ifdef CONFIG_XTENSA_MMU
xtensa_mmu_init();
#endif
XTENSA_WSR("PS", core_desc[core_id].ps);
XTENSA_WSR("VECBASE", core_desc[core_id].vecbase);
XTENSA_WSR("EXCSAVE2", core_desc[core_id].excsave2);
Expand All @@ -175,6 +172,9 @@ static ALWAYS_INLINE void _restore_core_context(void)
#if (XCHAL_NUM_MISC_REGS == 2)
XTENSA_WSR("MISC0", core_desc[core_id].misc[0]);
XTENSA_WSR("MISC1", core_desc[core_id].misc[1]);
#endif
#ifdef CONFIG_XTENSA_MMU
xtensa_mmu_reinit();
#endif
__asm__ volatile("mov a0, %0" :: "r"(core_desc[core_id].a0));
__asm__ volatile("mov a1, %0" :: "r"(core_desc[core_id].a1));
Expand Down

0 comments on commit a383504

Please sign in to comment.