Skip to content

Commit bb3f894

Browse files
evangreenpalmer-dabbelt
authored andcommitted
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. Fixes: 62a31d6 ("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>
1 parent 310c33d commit bb3f894

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

arch/riscv/errata/thead/errata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct al
118118
local_flush_icache_all();
119119
}
120120

121-
void __init_or_module thead_feature_probe_func(unsigned int cpu,
122-
unsigned long archid,
123-
unsigned long impid)
121+
void thead_feature_probe_func(unsigned int cpu,
122+
unsigned long archid,
123+
unsigned long impid)
124124
{
125125
if ((archid == 0) && (impid == 0))
126126
per_cpu(misaligned_access_speed, cpu) = RISCV_HWPROBE_MISALIGNED_FAST;

arch/riscv/include/asm/alternative.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define ALT_OLD_PTR(a) __ALT_PTR(a, old_offset)
3131
#define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
3232

33-
void __init probe_vendor_features(unsigned int cpu);
33+
void probe_vendor_features(unsigned int cpu);
3434
void __init apply_boot_alternatives(void);
3535
void __init apply_early_boot_alternatives(void);
3636
void apply_module_alternatives(void *start, size_t length);

arch/riscv/kernel/alternative.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct cpu_manufacturer_info_t {
3131
unsigned long impid);
3232
};
3333

34-
static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info)
34+
static void riscv_fill_cpu_mfr_info(struct cpu_manufacturer_info_t *cpu_mfr_info)
3535
{
3636
#ifdef CONFIG_RISCV_M_MODE
3737
cpu_mfr_info->vendor_id = csr_read(CSR_MVENDORID);
@@ -144,7 +144,7 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
144144
}
145145

146146
/* Called on each CPU as it starts */
147-
void __init_or_module probe_vendor_features(unsigned int cpu)
147+
void probe_vendor_features(unsigned int cpu)
148148
{
149149
struct cpu_manufacturer_info_t cpu_mfr_info;
150150

0 commit comments

Comments
 (0)