Re: [PATCH 1/5] riscv: smp: Move enum ipi_message_type to asm/smp.h

From: Uwe Kleine-König

Date: Mon Sep 21 2026 - 02:54:42 EST


On Fri, Sep 11, 2026 at 09:17:11AM +0800, Guo Ren wrote:
> On Wed, Sep 9, 2026 at 6:23 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
> >
> > 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.
>
> I prefer to keep IPI_MAX for SMP and rename IPI_MAX in mtk_vpu.h to
> VPU_IPI_MAX, consistent with SCP_IPI_MAX in mtk_scp.h.

That's why using driver specific prefixes are great. Why not
MTK_VPU_IPI_MAX or something along these lines?

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature