diff mbox series

RISC-V: hwprobe: Remove __init on probe_vendor_features()

Message ID 20230420194934.1871356-1-evan@rivosinc.com (mailing list archive)
State Accepted
Headers show
Series RISC-V: hwprobe: Remove __init on probe_vendor_features() | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD 310c33dc7a12
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 1 and now 1
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 3291 this patch: 3291
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 17626 this patch: 17626
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 36 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes fail Problems with Fixes tag: 1
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Evan Green April 20, 2023, 7:49 p.m. UTC
probe_vendor_features() is now called from smp_callin(), which is not
__init code and runs during cpu hotplug events. Remove the
__init_or_module decoration from it and the functions it calls to avoid
walking into outer space.

Fixes: 62a31d6e38bd ("RISC-V: hwprobe: Support probing of misaligned access performance")

Signed-off-by: Evan Green <evan@rivosinc.com>
---

 arch/riscv/errata/thead/errata.c     | 6 +++---
 arch/riscv/include/asm/alternative.h | 2 +-
 arch/riscv/kernel/alternative.c      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

Comments

Conor Dooley April 21, 2023, 5:48 p.m. UTC | #1
Yo Evan,

On Thu, Apr 20, 2023 at 12:49:34PM -0700, Evan Green wrote:
> probe_vendor_features() is now called from smp_callin(), which is not
> __init code and runs during cpu hotplug events. Remove the
> __init_or_module decoration from it and the functions it calls to avoid
> walking into outer space.
> 
> Fixes: 62a31d6e38bd ("RISC-V: hwprobe: Support probing of misaligned access performance")
>

BTW, in the future, no empty line between trailers.

> Signed-off-by: Evan Green <evan@rivosinc.com>

Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.
Palmer Dabbelt April 26, 2023, 2:27 p.m. UTC | #2
On Thu, 20 Apr 2023 12:49:34 -0700, Evan Green wrote:
> probe_vendor_features() is now called from smp_callin(), which is not
> __init code and runs during cpu hotplug events. Remove the
> __init_or_module decoration from it and the functions it calls to avoid
> walking into outer space.
> 
> Fixes: 62a31d6e38bd ("RISC-V: hwprobe: Support probing of misaligned access performance")
> 
> [...]

Applied, thanks!

[1/1] RISC-V: hwprobe: Remove __init on probe_vendor_features()
      https://git.kernel.org/palmer/c/bb3f89487fd9

Best regards,
diff mbox series

Patch

diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c
index 1036b8f933ec..a86c4facc2a6 100644
--- a/arch/riscv/errata/thead/errata.c
+++ b/arch/riscv/errata/thead/errata.c
@@ -118,9 +118,9 @@  void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct al
 		local_flush_icache_all();
 }
 
-void __init_or_module thead_feature_probe_func(unsigned int cpu,
-					       unsigned long archid,
-					       unsigned long impid)
+void thead_feature_probe_func(unsigned int cpu,
+			      unsigned long archid,
+			      unsigned long impid)
 {
 	if ((archid == 0) && (impid == 0))
 		per_cpu(misaligned_access_speed, cpu) = RISCV_HWPROBE_MISALIGNED_FAST;
diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
index a8f5cf6694a1..6a41537826a7 100644
--- a/arch/riscv/include/asm/alternative.h
+++ b/arch/riscv/include/asm/alternative.h
@@ -30,7 +30,7 @@ 
 #define ALT_OLD_PTR(a)			__ALT_PTR(a, old_offset)
 #define ALT_ALT_PTR(a)			__ALT_PTR(a, alt_offset)
 
-void __init probe_vendor_features(unsigned int cpu);
+void probe_vendor_features(unsigned int cpu);
 void __init apply_boot_alternatives(void);
 void __init apply_early_boot_alternatives(void);
 void apply_module_alternatives(void *start, size_t length);
diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
index fc65c9293ac5..6b75788c18e6 100644
--- a/arch/riscv/kernel/alternative.c
+++ b/arch/riscv/kernel/alternative.c
@@ -31,7 +31,7 @@  struct cpu_manufacturer_info_t {
 				   unsigned long impid);
 };
 
-static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info)
+static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info)
 {
 #ifdef CONFIG_RISCV_M_MODE
 	cpu_mfr_info->vendor_id = csr_read(CSR_MVENDORID);
@@ -144,7 +144,7 @@  void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
 }
 
 /* Called on each CPU as it starts */
-void __init_or_module probe_vendor_features(unsigned int cpu)
+void probe_vendor_features(unsigned int cpu)
 {
 	struct cpu_manufacturer_info_t cpu_mfr_info;