Skip to content

library_manager: Guard DRAM store/restore with CONFIG_ADSP_IMR_CONTEX…#11019

Open
lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:fix-context-save
Open

library_manager: Guard DRAM store/restore with CONFIG_ADSP_IMR_CONTEX…#11019
lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:fix-context-save

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

…T_SAVE

When ADSP IMR context save is disabled (CONFIG_ADSP_IMR_CONTEXT_SAVE=n), the HP-SRAM and L3 heap memory are lost during PM runtime suspend/resume. However, the LLEXT library manager state lib_manager_dram resides in the persistent IMR data section (__imrdata) and retains stale pointers (such as lib_manager_dram.ctx pointing to the now-invalid L3 heap address from the first boot).

On resume, llext_manager_restore_from_dram() would try to restore libraries from these stale pointers, causing register window underflows and fatal exceptions (EXCCAUSE_ILLEGAL) when executing scheduler work queues on subsequent IPC handling.

Guard llext_manager_store_to_dram() and llext_manager_restore_from_dram() with IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE). If context save is disabled, the library manager cleanly re-initializes on resume boot, forcing libraries to reload correctly.

…T_SAVE

When ADSP IMR context save is disabled (CONFIG_ADSP_IMR_CONTEXT_SAVE=n),
the HP-SRAM and L3 heap memory are lost during PM runtime suspend/resume.
However, the LLEXT library manager state `lib_manager_dram` resides in
the persistent IMR data section (`__imrdata`) and retains stale pointers
(such as `lib_manager_dram.ctx` pointing to the now-invalid L3 heap
address from the first boot).

On resume, `llext_manager_restore_from_dram()` would try to restore
libraries from these stale pointers, causing register window underflows
and fatal exceptions (EXCCAUSE_ILLEGAL) when executing scheduler work
queues on subsequent IPC handling.

Guard `llext_manager_store_to_dram()` and `llext_manager_restore_from_dram()`
with `IS_ENABLED(CONFIG_ADSP_IMR_CONTEXT_SAVE)`. If context save is
disabled, the library manager cleanly re-initializes on resume boot,
forcing libraries to reload correctly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood

Copy link
Copy Markdown
Member Author

@lyakh found via breadcrumbs. Not sure if you've seen or are aware of similar during userspace work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants