From 344428d8322e03cc5059a25769694f7622fb9333 Mon Sep 17 00:00:00 2001 From: Ben Zong-You Xie Date: Tue, 28 Jul 2026 16:10:35 +0800 Subject: [PATCH] lib: utils/cache: fix andes_llcache_enable() return value The driver returned 1 on success where callers expect 0, so the suspend to RAM aborted right after disabling the LLC and before flushing it. Fixes: 82b0961821e4 ("lib: utils/cache: add Andes last level cache controller") Signed-off-by: Ben Zong-You Xie Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260728081041.2724668-2-ben717@andestech.com Signed-off-by: Anup Patel --- lib/utils/cache/fdt_andes_llcache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/utils/cache/fdt_andes_llcache.c b/lib/utils/cache/fdt_andes_llcache.c index 490503ee..a3a2d37f 100644 --- a/lib/utils/cache/fdt_andes_llcache.c +++ b/lib/utils/cache/fdt_andes_llcache.c @@ -102,7 +102,10 @@ static int andes_llcache_enable(struct cache_device *dev, bool enable) } llcache_ctrl = readl(ctrl_addr); - return enable == EXTRACT_FIELD(llcache_ctrl, LLCACHE_REG_CTRL_EN_MASK); + if (enable != EXTRACT_FIELD(llcache_ctrl, LLCACHE_REG_CTRL_EN_MASK)) + return SBI_EFAIL; + + return SBI_OK; } static struct cache_ops andes_llcache_ops = {