All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kyrie Wu" <kyrie.wu@mediatek.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	media-ci@linuxtv.org
Subject: Re: [PATCH v7 12/14] media: mediatek: vcodec: clean xpc status
Date: Wed, 23 Sep 2026 03:02:40 +0000	[thread overview]
Message-ID: <20260923030241.0130A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923024258.257846-13-kyrie.wu@mediatek.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] media: mediatek: wrong enum type used to index main_dev->reg_base array
--

commit c332070b6bf8a16fa63f12155e0ac06b323d2142
Author: Kyrie Wu <kyrie.wu@mediatek.com>

media: mediatek: vcodec: clean xpc status

The driver need to clean xpc status when receive decoder hardware
interrupt for mt8196 platform.

> diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c
> index 881d5de41e050..46ac3e41c401c 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_hw.c

[ ... ]

> @@ -166,6 +196,7 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)
>  	subdev_dev->hw_idx = hw_idx;
>  	subdev_dev->main_dev = main_dev;
>  	subdev_dev->reg_base[VDEC_HW_SYS] = main_dev->reg_base[VDEC_HW_SYS];
> +	subdev_dev->reg_base[VDEC_HW_XPC] = main_dev->reg_base[VDEC_HW_MISC];
                                                                     ^^^^^^^^^^^^

[Severity: Low]
Is the wrong enum type used here to index main_dev->reg_base?

The array main_dev->reg_base is explicitly sized by NUM_MAX_VCODEC_REG_BASE
and expects to be indexed by enum mtk_hw_reg_idx (which includes VDEC_MISC).
However, this line uses VDEC_HW_MISC, which belongs to enum
mtk_vdec_hw_reg_idx.

While both VDEC_MISC and VDEC_HW_MISC happen to evaluate to 1, avoiding an
out-of-bounds fault or incorrect register access today, this cross-enum
type mismatch creates a logic flaw that could be fragile if the enums change
in the future.

>  	set_bit(subdev_dev->hw_idx, main_dev->subdev_bitmap);
>  
>  	if (IS_SUPPORT_VDEC_HW_IRQ(hw_idx)) {

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923024258.257846-1-kyrie.wu@mediatek.com?part=12

  reply	other threads:[~2026-09-23  3:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23  2:42 [PATCH v7 00/14] media: mediatek: vcodec: support video decoder in mt8196 Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 01/14] media: mediatek: vcodec: support vcp architecture Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 02/14] media: mediatek: vcodec: add driver to support vcp Kyrie Wu
2026-09-23  2:57   ` sashiko-bot
2026-09-23  2:42 ` [PATCH v7 03/14] media: mediatek: vcodec: add driver to support vcp encoder Kyrie Wu
2026-09-23  3:06   ` sashiko-bot
2026-09-23  2:42 ` [PATCH v7 04/14] media: mediatek: vcodec: get different firmware ipi id Kyrie Wu
2026-09-23  3:03   ` sashiko-bot
2026-09-23  2:42 ` [PATCH v7 05/14] media: mediatek: vcodec: get share memory address Kyrie Wu
2026-09-23  2:58   ` sashiko-bot
2026-09-23  2:42 ` [PATCH v7 06/14] media: mediatek: vcodec: add debug information Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 07/14] media: mediatek: vcodec: send share memory address to vcp Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 08/14] Add the MT8196 compatible string to the MediaTek vcodec subdev decoder binding Kyrie Wu
2026-10-06 14:35   ` Rob Herring
2026-10-06 14:35     ` Rob Herring
2026-09-23  2:42 ` [PATCH v7 09/14] media: mediatek: vcodec: add decoder compatible to support mt8196 Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 10/14] media: mediatek: vcodec: define MT8196 vcodec levels Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 11/14] media: mediatek: vcodec: support 36bit iova address Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 12/14] media: mediatek: vcodec: clean xpc status Kyrie Wu
2026-09-23  3:02   ` sashiko-bot [this message]
2026-09-23  2:42 ` [PATCH v7 13/14] media: mediatek: decoder: fill av1 buffer size with picinfo Kyrie Wu
2026-09-23  2:42 ` [PATCH v7 14/14] media: mediatek: decoder: support av1 extend vsi Kyrie Wu
2026-09-23  3:00   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260923030241.0130A1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kyrie.wu@mediatek.com \
    --cc=media-ci@linuxtv.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.