[PATCH 1/7] lib: utils/cache: fix andes_llcache_enable() return value
Ben Zong-You Xie
ben717 at andestech.com
Tue Jul 28 01:10:35 PDT 2026
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 <ben717 at andestech.com>
---
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 490503ee611c..a3a2d37feb82 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 = {
--
2.34.1
More information about the opensbi
mailing list