riscv: remove log_debug() in enable_caches()
PATCH 1/1 riscv: remove log_debug() in enable_caches()
log_debug() cannot be used before log_init() has been called. Remove the log_debug() statement in enable_caches() since it is called after log_init() in initcall_run_r().
This fixes a bug where a RISC-V system which does not have the "zicbom" extension (such as PIC64-HPSC/HX) would get lost in an infinite loop in log_dispatch().
--- arch/riscv/lib/cache.c | 2 -- 1 file changed, 2 deletions(-)
arch/riscv/lib/cache.c +0 -2
@@ -149,8 +149,6 @@ __weak int dcache_status(void)__weak void enable_caches (void ) { zicbom_block_size =riscv_get_cbom_block_size (); -if (!zicbom_block_size) -log_debug ("Zicbom not initialized.\n" ); }int __weak pgprot_set_attrs (phys_addr_t addr,size_t size,enum pgprot_attrs perm)
Signature · 1 line
2.47.3
Quoted 8 lines · Charles Perry
log_debug()cannot be used beforelog_init()has been called. Remove thelog_debug()statement inenable_caches()since it is called afterlog_init()ininitcall_run_r().This fixes a bug where a RISC-V system which does not have the "zicbom" extension (such as PIC64-HPSC/HX) would get lost in an infinite loop in
log_dispatch().
Quoted 5 lines
Fixes 9e859849e2ca ("riscv: cache: Add CBO instructions")Signed-off-by Charles Perry <[email protected]>--- arch/riscv/lib/cache.c | 2 -- 1 file changed, 2 deletions(-)
Applied to u-boot-riscv/main, thanks.
Best regards,
Leo
Quoted 2 lines
Date: Sat, 25 Jul 2026 18:41:58 +0800
From: Leo Liang via U-Boot <[email protected]>
Sorry I didn't spot it before but...
Quoted 4 lines · Charles Perry
Quoted 3 lines
log_debug()cannot be used beforelog_init()has been called. Remove thelog_debug()statement inenable_caches()since it is called afterlog_init()ininitcall_run_r().
This part of the commit message contradicts itself. Should "after" in the second sentence be "before"?
Quoted 18 lines
Quoted 10 lines
This fixes a bug where a RISC-V system which does not have the "zicbom" extension (such as PIC64-HPSC/HX) would get lost in an infinite loop in
log_dispatch().Fixes 9e859849e2ca ("riscv: cache: Add CBO instructions")Signed-off-by Charles Perry <[email protected]>--- arch/riscv/lib/cache.c | 2 -- 1 file changed, 2 deletions(-)Applied to u-boot-riscv/main, thanks.
Reviewed-by Leo Yu-Chi Liang <[email protected]>Best regards,
Leo
Hi Mark,
Quoted 6 lines · Mark Kettenis
Quoted 3 lines
Date: Sat, 25 Jul 2026 18:41:58 +0800
From: Leo Liang via U-Boot <[email protected]>Sorry I didn't spot it before but...
Quoted 8 lines
Quoted 4 lines · Charles Perry
Quoted 3 lines
log_debug()cannot be used beforelog_init()has been called. Remove thelog_debug()statement inenable_caches()since it is called afterlog_init()ininitcall_run_r().This part of the commit message contradicts itself. Should "after" in the second sentence be "before"?
Thanks for the catch!
It should be
'log_debug() statement in enable_caches() since it is called **before** log_init() in initcall_run_r().'
I will correct it when merging the patch.
Best regards,
Leo
Quoted 18 lines
Quoted 18 lines
Quoted 10 lines
This fixes a bug where a RISC-V system which does not have the "zicbom" extension (such as PIC64-HPSC/HX) would get lost in an infinite loop in
log_dispatch().Fixes 9e859849e2ca ("riscv: cache: Add CBO instructions")Signed-off-by Charles Perry <[email protected]>--- arch/riscv/lib/cache.c | 2 -- 1 file changed, 2 deletions(-)Applied to u-boot-riscv/main, thanks.
Reviewed-by Leo Yu-Chi Liang <[email protected]>Best regards,
Leo