All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kyrie Wu" <kyrie.wu@mediatek.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
	media-ci@linuxtv.org, robh@kernel.org
Subject: Re: [PATCH v6 07/14] media: mediatek: vcodec: send share memory address to vcp
Date: Mon, 20 Jul 2026 01:32:24 +0000	[thread overview]
Message-ID: <20260720013225.5C01C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260720012056.1026551-8-kyrie.wu@mediatek.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Unconditional increase in firmware IPC message size may break backwards compatibility with older SCP/VPU firmware.
--

--- Patch [7]: [PATCH v6 07/14] media: mediatek: vcodec: send share memory address to vcp ---
commit 84b64e642819aa5202009e5076e47823645bcbc0
Author: Kyrie Wu <kyrie.wu@mediatek.com>

media: mediatek: vcodec: send share memory address to vcp

This commit updates the AP to VPU initialization message by adding a shared
memory address field. It is used specifically for the VCP architecture where
shared memory is allocated in the kernel rather than reserved in the VPU.

> diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h b/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h
> index 47070be2a9914..097561a1efdcf 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_ipi_msg.h

[ ... ]

>  struct vdec_ap_ipi_init {
>  	uint32_t msg_id;
>  	u32 codec_type;
>  	uint64_t ap_inst_addr;
> +	u64 shared_iova;
>  };

[ ... ]

> diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> index cdb673e6b4770..3a10b32be0945 100644
> --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec_vpu_if.c
> @@ -236,6 +236,8 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
>  	msg.msg_id = AP_IPIMSG_DEC_INIT;
>  	msg.ap_inst_addr = (unsigned long)vpu;
>  	msg.codec_type = vpu->codec_type;
> +	if (mtk_vcodec_fw_get_type(vpu->ctx->dev->fw_handler) == VCP)
> +		msg.shared_iova = vpu->ctx->dev->fw_handler->vcp->iova_addr;
>  
>  	mtk_vdec_debug(vpu->ctx, "vdec_inst=%p", vpu);

[Severity: Medium]
Does this unconditional size increase break backwards compatibility with older
SCP/VPU firmware?

By adding shared_iova to struct vdec_ap_ipi_init, the struct size increases
from 16 bytes to 24 bytes. Directly after this diff hunk in vpu_dec_init(),
the message is sent to the firmware using the full sizeof(msg):

err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));

If older firmware expects a strictly sized 16-byte initialization message,
could sending 24 bytes unconditionally cause the initialization to fail and
render the video decoder unusable on existing non-VCP devices?

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

  reply	other threads:[~2026-07-20  1:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-20  1:20 [PATCH v6 00/14] media: mediatek: vcodec: support video decoder in mt8196 Kyrie Wu
2026-07-20  1:20 ` [PATCH v6 01/14] media: mediatek: vcodec: support vcp architecture Kyrie Wu
2026-07-20  1:36   ` sashiko-bot
2026-07-20 12:57   ` Nicolas Dufresne
2026-07-20  1:20 ` [PATCH v6 02/14] media: mediatek: vcodec: add driver to support vcp Kyrie Wu
2026-07-20  1:36   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 03/14] media: mediatek: vcodec: add driver to support vcp encoder Kyrie Wu
2026-07-20  1:45   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 04/14] media: mediatek: vcodec: get different firmware ipi id Kyrie Wu
2026-07-20  1:44   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 05/14] media: mediatek: vcodec: get share memory address Kyrie Wu
2026-07-20  1:40   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 06/14] media: mediatek: vcodec: add debug information Kyrie Wu
2026-07-20  1:31   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 07/14] media: mediatek: vcodec: send share memory address to vcp Kyrie Wu
2026-07-20  1:32   ` sashiko-bot [this message]
2026-07-20  1:20 ` [PATCH v6 08/14] dt-bindings: media: mediatek: vcodec: add decoder dt-bindings for mt8196 Kyrie Wu
2026-07-20  1:29   ` sashiko-bot
2026-07-20  5:46   ` Krzysztof Kozlowski
2026-07-20  5:46     ` Krzysztof Kozlowski
2026-07-20  5:49     ` Krzysztof Kozlowski
2026-07-20  5:49       ` Krzysztof Kozlowski
2026-07-20  6:26       ` Kyrie Wu (吴晗)
2026-07-20  6:26         ` Kyrie Wu (吴晗)
2026-07-20 10:19         ` Krzysztof Kozlowski
2026-07-20 10:19           ` Krzysztof Kozlowski
2026-07-20  1:20 ` [PATCH v6 09/14] media: mediatek: vcodec: add decoder compatible to support mt8196 Kyrie Wu
2026-07-20  1:36   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 10/14] media: mediatek: vcodec: define MT8196 vcodec levels Kyrie Wu
2026-07-20  1:20 ` [PATCH v6 11/14] media: mediatek: vcodec: support 36bit iova address Kyrie Wu
2026-07-20  1:20 ` [PATCH v6 12/14] media: mediatek: vcodec: clean xpc status Kyrie Wu
2026-07-20  2:03   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 13/14] media: mediatek: decoder: fill av1 buffer size with picinfo Kyrie Wu
2026-07-20  1:48   ` sashiko-bot
2026-07-20  1:20 ` [PATCH v6 14/14] media: mediatek: decoder: support av1 extend vsi Kyrie Wu
2026-07-20  1:50   ` 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=20260720013225.5C01C1F000E9@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.