media: mtk-vpu: rename IPI_MAX to IPI_VPU_MAX

The last enumerator of this driver's firmware IPI id list is a bound
for the VPU mailbox protocol, not a generic host IPI limit. Follow the
existing naming in this header: IPI_VPU_INIT already carries a VPU
prefix, so the terminator should match.

The same convention is used by the SCP IPI enum, which ends with a
prefixed SCP_IPI_MAX rather than a bare IPI_MAX.

Rename IPI_MAX to IPI_VPU_MAX and update the descriptor table bounds
and range checks. No functional change.

Link: https://lore.kernel.org/linux-riscv/20260908222349.GA2324870@ax162
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: GUO Ren (XuanTie) <guoren@kernel.org>
Reviewed-by: Radu Rendec <radu@rendec.net>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
GUO Ren (XuanTie) 2026-09-11 03:27:14 +00:00 committed by Hans Verkuil
parent 1c15d0a83d
commit d1d2645e75
2 changed files with 8 additions and 8 deletions

View File

@ -211,7 +211,7 @@ struct mtk_vpu {
struct vpu_regs reg;
struct vpu_run run;
struct vpu_wdt wdt;
struct vpu_ipi_desc ipi_desc[IPI_MAX];
struct vpu_ipi_desc ipi_desc[IPI_VPU_MAX];
struct share_obj __iomem *recv_buf;
struct share_obj __iomem *send_buf;
struct device *dev;
@ -221,7 +221,7 @@ struct mtk_vpu {
struct mutex vpu_mutex; /* for protecting vpu data data structure */
u32 wdt_refcnt;
wait_queue_head_t ack_wq;
bool ipi_id_ack[IPI_MAX];
bool ipi_id_ack[IPI_VPU_MAX];
};
static inline void vpu_cfg_writel(struct mtk_vpu *vpu, u32 val, u32 offset)
@ -296,7 +296,7 @@ int vpu_ipi_register(struct platform_device *pdev,
return -EPROBE_DEFER;
}
if (id < IPI_MAX && handler) {
if (id < IPI_VPU_MAX && handler) {
ipi_desc = vpu->ipi_desc;
ipi_desc[id].name = name;
ipi_desc[id].handler = handler;
@ -319,7 +319,7 @@ int vpu_ipi_send(struct platform_device *pdev,
unsigned long timeout;
int ret = 0;
if (id <= IPI_VPU_INIT || id >= IPI_MAX ||
if (id <= IPI_VPU_INIT || id >= IPI_VPU_MAX ||
len > sizeof(send_obj->share_buf) || !buf) {
dev_err(vpu->dev, "failed to send ipi message\n");
return -EINVAL;
@ -748,7 +748,7 @@ static void vpu_ipi_handler(struct mtk_vpu *vpu)
s32 id = readl(&rcv_obj->id);
memcpy_fromio(data, rcv_obj->share_buf, sizeof(data));
if (id < IPI_MAX && ipi_desc[id].handler) {
if (id < IPI_VPU_MAX && ipi_desc[id].handler) {
ipi_desc[id].handler(data, readl(&rcv_obj->len),
ipi_desc[id].priv);
if (id > IPI_VPU_INIT) {
@ -934,7 +934,7 @@ static int mtk_vpu_probe(struct platform_device *pdev)
#ifdef CONFIG_DEBUG_FS
debugfs_remove(vpu_debugfs);
#endif
memset(vpu->ipi_desc, 0, sizeof(struct vpu_ipi_desc) * IPI_MAX);
memset(vpu->ipi_desc, 0, sizeof(struct vpu_ipi_desc) * IPI_VPU_MAX);
vpu_mutex_destroy:
mutex_destroy(&vpu->vpu_mutex);
disable_vpu_clk:

View File

@ -49,7 +49,7 @@ typedef void (*ipi_handler_t) (void *data,
* handle VP8 video encoder job,, and vice versa.
* @IPI_MDP: The interrupt from vpu is to notify kernel to
* handle MDP (Media Data Path) job, and vice versa.
* @IPI_MAX: The maximum IPI number
* @IPI_VPU_MAX: The maximum VPU IPI number
*/
enum ipi_id {
@ -60,7 +60,7 @@ enum ipi_id {
IPI_VENC_H264,
IPI_VENC_VP8,
IPI_MDP,
IPI_MAX,
IPI_VPU_MAX,
};
/**