RISC-V: hwprobe: Remove __init on probe_vendor_features()
PATCH 1/1 RISC-V: hwprobe: Remove __init on probe_vendor_features()
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.
---
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(-)
arch/riscv/errata/thead/errata.c +3 -3
@@ -118,9 +118,9 @@ void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct allocal_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 ;
arch/riscv/include/asm/alternative.h +1 -1
@@ -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);
arch/riscv/kernel/alternative.c +2 -2
@@ -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;
Signature · 1 line
2.25.1
Yo Evan,
Quoted 7 lines · Evan Green
probe_vendor_features()is now called fromsmp_callin(), which is not__initcode and runs during cpu hotplug events. Remove the__init_or_moduledecoration 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.
Quoted 1 line
Signed-off-by Evan Green <[email protected]>
Otherwise,
Thanks,
Conor.
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt
AppliedQuoted 8 lines · Evan Green
probe_vendor_features()is now called fromsmp_callin(), which is not__initcode and runs during cpu hotplug events. Remove the__init_or_moduledecoration 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,
Signature · 1 line
Palmer Dabbelt <[email protected]>