aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJisheng Zhang <[email protected]>2023-01-29 01:28:44 +0800
committerPalmer Dabbelt <[email protected]>2023-01-31 23:29:33 -0800
commitabcc445acdbeb561e881fcbd8e1dc4684628cc9b (patch)
treeac49d17e678fb6068512758b3232a5b240fb6988
parent285b6a18daf1358e70a4c842884d9ff2d2fe53e2 (diff)
riscv: move riscv_noncoherent_supported() out of ZICBOM probe
It's a bit weird to call riscv_noncoherent_supported() each time when insmoding a module. Move the calling out of feature patch func. Signed-off-by: Jisheng Zhang <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
-rw-r--r--arch/riscv/kernel/cpufeature.c1
-rw-r--r--arch/riscv/kernel/setup.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index dde0e91d7668..62443fd32fa7 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -298,7 +298,6 @@ static bool __init_or_module cpufeature_probe_zicbom(unsigned int stage)
if (!riscv_isa_extension_available(NULL, ZICBOM))
return false;
- riscv_noncoherent_supported();
return true;
}
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 86acd690d529..376d2827e736 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -300,6 +300,9 @@ void __init setup_arch(char **cmdline_p)
riscv_init_cbom_blocksize();
riscv_fill_hwcap();
apply_boot_alternatives();
+ if (IS_ENABLED(CONFIG_RISCV_ISA_ZICBOM) &&
+ riscv_isa_extension_available(NULL, ZICBOM))
+ riscv_noncoherent_supported();
}
static int __init topology_init(void)