aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2020-11-04 16:04:36 -0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-11-25 16:05:17 -0800
commit62149f3564c5a59cb42834cbe97e6f36ad81a029 (patch)
tree8b7bcec6c469028991a71d934f3153d086aa32f5
parentriscv: Enable ARCH_STACKWALK (diff)
downloadlinux-dev-62149f3564c5a59cb42834cbe97e6f36ad81a029.tar.xz
linux-dev-62149f3564c5a59cb42834cbe97e6f36ad81a029.zip
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 <atish.patra@wdc.com> Tested-by: Greentime Hu <greentime.hu@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-rw-r--r--arch/riscv/kernel/setup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 515b5a662706..20470e5a7d3c 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -249,6 +249,9 @@ void __init setup_arch(char **cmdline_p)
pr_err("No DTB found in kernel mappings\n");
#endif
+ if (IS_ENABLED(CONFIG_RISCV_SBI))
+ sbi_init();
+
#ifdef CONFIG_SWIOTLB
swiotlb_init(1);
#endif
@@ -257,10 +260,6 @@ void __init setup_arch(char **cmdline_p)
kasan_init();
#endif
-#if IS_ENABLED(CONFIG_RISCV_SBI)
- sbi_init();
-#endif
-
#ifdef CONFIG_SMP
setup_smp();
#endif