[PATCH 1/5] riscv: smp: Move enum ipi_message_type to asm/smp.h
Guo Ren
guoren at kernel.org
Mon Sep 28 01:42:16 PDT 2026
On Mon, Sep 21, 2026 at 2:45 PM Uwe Kleine-König
<u.kleine-koenig at baylibre.com> wrote:
>
> 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 at kernel.org> wrote:
> > >
> > > On Sun, Aug 16, 2026 at 07:00:45AM +0000, Guo Ren wrote:
> > > > From: "GUO Ren (XuanTie)" <guoren at kernel.org>
> > > >
> > > > 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?
I agree that a driver-specific prefix such as MTK_VPU_ would be
clearer. One correction to my earlier reply: the patch uses
IPI_VPU_MAX, not VPU_IPI_MAX. This follows the existing IPI_VPU_INIT
naming in mtk_vpu.h; the other identifiers use prefixes such as
IPI_VDEC_ and IPI_VENC_.
The intent of this patch [1] is to fix the IPI_MAX collision with a
minimal change. Applying a consistent MTK_VPU_ prefix across the enum
would be a broader cleanup, which I think is best handled separately
in coordination with the driver maintainers.
[1] https://lore.kernel.org/all/20260911-ipi_max-v2-6-a77826ff189e@kernel.org/
--
Best Regards
Guo Ren
More information about the linux-riscv
mailing list