From 9ceaf4738a62ec990dcd0e797243bb6e78508291 Mon Sep 17 00:00:00 2001 From: Ben Zong-You Xie Date: Tue, 28 Jul 2026 16:10:38 +0800 Subject: [PATCH] lib: utils/suspend: restore Andes CSRs on system-suspend resume A deep sleep resume leaves the boot hart in SUSPENDED state, so init_warmboot() dispatches to init_warm_resume(), which calls the SUSP device's system_resume callback and not sbi_platform_early_init(). The restore in ae350_early_init() is dead code on that path. Fixes: b27ecec76b8a ("lib: utils/suspend: add Andes ATCSMU suspend driver") Signed-off-by: Ben Zong-You Xie Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260728081041.2724668-5-ben717@andestech.com Signed-off-by: Anup Patel --- lib/utils/suspend/fdt_suspend_andes_atcsmu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/suspend/fdt_suspend_andes_atcsmu.c b/lib/utils/suspend/fdt_suspend_andes_atcsmu.c index 072accc0..6722b70f 100644 --- a/lib/utils/suspend/fdt_suspend_andes_atcsmu.c +++ b/lib/utils/suspend/fdt_suspend_andes_atcsmu.c @@ -91,8 +91,10 @@ static void ae350_system_resume(void) u32 hartid = current_hartid(); u32 sleep_type = atcsmu_get_sleep_type(hartid); - if (sleep_type == SBI_SUSP_SLEEP_TYPE_SUSPEND) + if (sleep_type == SBI_SUSP_SLEEP_TYPE_SUSPEND) { fdt_cmo_llc_enable(true); + ae350_non_ret_restore(sbi_scratch_thishart_ptr()); + } } static struct sbi_system_suspend_device suspend_andes_atcsmu = {