RISC-V: hwprobe: Remove __init on probe_vendor_features()
authorEvan Green <evan@rivosinc.com>
Thu, 20 Apr 2023 19:49:34 +0000 (12:49 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 26 Apr 2023 04:58:42 +0000 (21:58 -0700)
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>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230420194934.1871356-1-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/errata/thead/errata.c
arch/riscv/include/asm/alternative.h
arch/riscv/kernel/alternative.c

index 1036b8f933ec7d3760499a22f13b1c7e2b49cdce..a86c4facc2a69906fa5cbaa6bcce304db9ab7543 100644 (file)
@@ -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;
index a8f5cf6694a1190160a246d4fe2afd112341167a..6a41537826a7dc9d6451a6185887cabbeefcf72f 100644 (file)
@@ -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);
index fc65c9293ac562e80a6ebaf30209b4b11e47912e..6b75788c18e66c70a6ec6e21c8f91ef0d36c490d 100644 (file)
@@ -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;