Skip to content

Commit 62750ea

Browse files
vlsunilpalmer-dabbelt
authored andcommitted
riscv: smp: Add 64bit hartid support on RV64
The hartid can be a 64bit value on RV64 platforms. Modify the hartid parameter in riscv_hartid_to_cpuid() as unsigned long so that it can hold 64bit value on RV64 platforms. Signed-off-by: Sunil V L <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent c029e48 commit 62750ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/riscv/include/asm/smp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void arch_send_call_function_ipi_mask(struct cpumask *mask);
4242
/* Hook for the generic smp_call_function_single() routine. */
4343
void arch_send_call_function_single_ipi(int cpu);
4444

45-
int riscv_hartid_to_cpuid(int hartid);
45+
int riscv_hartid_to_cpuid(unsigned long hartid);
4646

4747
/* Set custom IPI operations */
4848
void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops);
@@ -70,7 +70,7 @@ static inline void show_ipi_stats(struct seq_file *p, int prec)
7070
{
7171
}
7272

73-
static inline int riscv_hartid_to_cpuid(int hartid)
73+
static inline int riscv_hartid_to_cpuid(unsigned long hartid)
7474
{
7575
if (hartid == boot_cpu_hartid)
7676
return 0;

arch/riscv/kernel/smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ static struct {
4747
unsigned long bits ____cacheline_aligned;
4848
} ipi_data[NR_CPUS] __cacheline_aligned;
4949

50-
int riscv_hartid_to_cpuid(int hartid)
50+
int riscv_hartid_to_cpuid(unsigned long hartid)
5151
{
5252
int i;
5353

5454
for (i = 0; i < NR_CPUS; i++)
5555
if (cpuid_to_hartid_map(i) == hartid)
5656
return i;
5757

58-
pr_err("Couldn't find cpu id for hartid [%d]\n", hartid);
58+
pr_err("Couldn't find cpu id for hartid [%lu]\n", hartid);
5959
return -ENOENT;
6060
}
6161

0 commit comments

Comments
 (0)