Re: [PATCH 1/5] riscv: smp: Move enum ipi_message_type to asm/smp.h
From: Nathan Chancellor
Date: Tue Sep 08 2026 - 18:24:07 EST
On Sun, Aug 16, 2026 at 07:00:45AM +0000, Guo Ren wrote:
> From: "GUO Ren (XuanTie)" <guoren@xxxxxxxxxx>
>
> The IPI message type enumeration (and therefore IPI_MAX) is currently
> private to arch/riscv/kernel/smp.c. Several IPI providers need to know
> the exact number of IPIs that the architecture requires, so move the
> enum into the public header.
>
> This is a pure code movement with no functional change.
Other than a build breakage with allmodconfig :) -next has this change
as commit 1ae91dc397eb ("riscv: smp: Move enum ipi_message_type to
asm/smp.h"), where it breaks allmodconfig with several errors along the
lines of:
In file included from drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c:20:
drivers/media/platform/mediatek/vpu/mtk_vpu.h:63:9: error: redeclaration of enumerator 'IPI_MAX'
63 | IPI_MAX,
| ^~~~~~~
In file included from include/linux/smp.h:119,
from include/linux/interrupt_rc.h:17,
from include/linux/spinlock.h:60,
from include/linux/sched.h:38,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c:8:
arch/riscv/include/asm/smp.h:27:9: note: previous definition of 'IPI_MAX' with type 'enum ipi_message_type'
27 | IPI_MAX
| ^~~~~~~
So one of these needs to change.
> Signed-off-by: GUO Ren (XuanTie) <guoren@xxxxxxxxxx>
> ---
> arch/riscv/include/asm/smp.h | 12 ++++++++++++
> arch/riscv/kernel/smp.c | 12 ------------
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
> index 0ecc67641b09..bed39fff1f8a 100644
> --- a/arch/riscv/include/asm/smp.h
> +++ b/arch/riscv/include/asm/smp.h
> @@ -15,6 +15,18 @@
> struct seq_file;
> extern unsigned long boot_cpu_hartid;
>
> +enum ipi_message_type {
> + IPI_RESCHEDULE,
> + IPI_CALL_FUNC,
> + IPI_CPU_STOP,
> + IPI_CPU_CRASH_STOP,
> + IPI_IRQ_WORK,
> + IPI_TIMER,
> + IPI_CPU_BACKTRACE,
> + IPI_KGDB_ROUNDUP,
> + IPI_MAX
> +};
> +
> #ifdef CONFIG_SMP
>
> #include <linux/jump_label.h>
> diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
> index fa66f9c97d74..8930b62b15e7 100644
> --- a/arch/riscv/kernel/smp.c
> +++ b/arch/riscv/kernel/smp.c
> @@ -28,18 +28,6 @@
> #include <asm/cacheflush.h>
> #include <asm/cpu_ops.h>
>
> -enum ipi_message_type {
> - IPI_RESCHEDULE,
> - IPI_CALL_FUNC,
> - IPI_CPU_STOP,
> - IPI_CPU_CRASH_STOP,
> - IPI_IRQ_WORK,
> - IPI_TIMER,
> - IPI_CPU_BACKTRACE,
> - IPI_KGDB_ROUNDUP,
> - IPI_MAX
> -};
> -
> static const char * const ipi_names[] = {
> [IPI_RESCHEDULE] = "Rescheduling interrupts",
> [IPI_CALL_FUNC] = "Function call interrupts",
> --
> 2.43.0
>
--
Cheers,
Nathan