Skip to content

Commit 62149f3

Browse files
atishp04palmer-dabbelt
authored andcommitted
RISC-V: Initialize SBI early
Currently, SBI is initialized towards the end of arch setup. This prevents the set memory operations to be invoked earlier as it requires a full tlb flush. Initialize SBI as early as possible. Signed-off-by: Atish Patra <[email protected]> Tested-by: Greentime Hu <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 5cb0080 commit 62149f3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/riscv/kernel/setup.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ void __init setup_arch(char **cmdline_p)
249249
pr_err("No DTB found in kernel mappings\n");
250250
#endif
251251

252+
if (IS_ENABLED(CONFIG_RISCV_SBI))
253+
sbi_init();
254+
252255
#ifdef CONFIG_SWIOTLB
253256
swiotlb_init(1);
254257
#endif
@@ -257,10 +260,6 @@ void __init setup_arch(char **cmdline_p)
257260
kasan_init();
258261
#endif
259262

260-
#if IS_ENABLED(CONFIG_RISCV_SBI)
261-
sbi_init();
262-
#endif
263-
264263
#ifdef CONFIG_SMP
265264
setup_smp();
266265
#endif

0 commit comments

Comments
 (0)