Commit 62750eae authored by Sunil V L's avatar Sunil V L Committed by Palmer Dabbelt

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: default avatarSunil V L <sunilvl@ventanamicro.com>
Reviewed-by: default avatarHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: default avatarAtish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20220527051743.2829940-4-sunilvl@ventanamicro.comSigned-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent c029e487
...@@ -42,7 +42,7 @@ void arch_send_call_function_ipi_mask(struct cpumask *mask); ...@@ -42,7 +42,7 @@ void arch_send_call_function_ipi_mask(struct cpumask *mask);
/* Hook for the generic smp_call_function_single() routine. */ /* Hook for the generic smp_call_function_single() routine. */
void arch_send_call_function_single_ipi(int cpu); void arch_send_call_function_single_ipi(int cpu);
int riscv_hartid_to_cpuid(int hartid); int riscv_hartid_to_cpuid(unsigned long hartid);
/* Set custom IPI operations */ /* Set custom IPI operations */
void riscv_set_ipi_ops(const struct riscv_ipi_ops *ops); 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) ...@@ -70,7 +70,7 @@ static inline void show_ipi_stats(struct seq_file *p, int prec)
{ {
} }
static inline int riscv_hartid_to_cpuid(int hartid) static inline int riscv_hartid_to_cpuid(unsigned long hartid)
{ {
if (hartid == boot_cpu_hartid) if (hartid == boot_cpu_hartid)
return 0; return 0;
......
...@@ -47,7 +47,7 @@ static struct { ...@@ -47,7 +47,7 @@ static struct {
unsigned long bits ____cacheline_aligned; unsigned long bits ____cacheline_aligned;
} ipi_data[NR_CPUS] __cacheline_aligned; } ipi_data[NR_CPUS] __cacheline_aligned;
int riscv_hartid_to_cpuid(int hartid) int riscv_hartid_to_cpuid(unsigned long hartid)
{ {
int i; int i;
...@@ -55,7 +55,7 @@ int riscv_hartid_to_cpuid(int hartid) ...@@ -55,7 +55,7 @@ int riscv_hartid_to_cpuid(int hartid)
if (cpuid_to_hartid_map(i) == hartid) if (cpuid_to_hartid_map(i) == hartid)
return i; return i;
pr_err("Couldn't find cpu id for hartid [%d]\n", hartid); pr_err("Couldn't find cpu id for hartid [%lu]\n", hartid);
return -ENOENT; return -ENOENT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment