library_manager: Guard DRAM store/restore with CONFIG_ADSP_IMR_CONTEX… - #11019
library_manager: Guard DRAM store/restore with CONFIG_ADSP_IMR_CONTEX…#11019lgirdwood wants to merge 1 commit into
Conversation
…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>
|
@lyakh found via breadcrumbs. Not sure if you've seen or are aware of similar during userspace work. |
@lyakh this did fix RTD3 failure for me, I am wondering if the partial restore is still using some stale data on the next boot iteration ? e.g. something is being clobbered in HPSRAM. Btw, does this make any delta to your PM bug repro rate ? |
@lgirdwood which RTD3 failure do you mean? The PM bug is about failing suspend, not resume, isn't it? |
It would not resume from RTD3, maybe this is a smoking gun for the CI reported bug as it very much depends whats in HPSRAM and topology at suspend, |
…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_dramresides in the persistent IMR data section (__imrdata) and retains stale pointers (such aslib_manager_dram.ctxpointing 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()andllext_manager_restore_from_dram()withIS_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.