Skip to contentSkip to conversation

media: mediatek: vcodec: Handle invalid decoder vsi

PATCH In review [email protected] 4 participants 6 messages Dec 7, 2024 – Dec 11, 2024 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: mediatek: vcodec: Handle invalid decoder vsi

From: Irui Wang <[email protected]>

[ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]

Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.

Fixes 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
[ Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1 ]
---
 drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c +6 -0
index df309e8e9379..af3fc89b6cc5 100644
@@ -213,6 +213,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
 	mtk_vcodec_debug(vpu, "vdec_inst=%p", vpu);
 
 	err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
+
+	if (IS_ERR_OR_NULL(vpu->vsi)) {
+		mtk_vcodec_err(vpu, "invalid vdec vsi, status=%d", err);
+		return -EINVAL;
+	}
+
 	mtk_vcodec_debug(vpu, "- ret=%d", err);
 	return err;
 }
Signature · 1 line
2.43.0
maintainer
#1 lore raw

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 59d438f8e02ca641c58d77e1feffa000ff809e9f

WARNING: Author mismatch between patch and upstream commit:
Backport author: [email protected] Commit author: Irui Wang <[email protected]>

Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 1c109f23b271)
6.1.y | Not found

Note: The patch differs from the upstream commit:
---

1:  59d438f8e02ca < -:  ------------- media: mediatek: vcodec: Handle invalid decoder vsi
-:  ------------- > 1:  51597d231df9f media: mediatek: vcodec: Handle invalid decoder vsi

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |
maintainer
#3 lore raw
In reply to [email protected]
Quoted 15 lines · On Sat, Dec 07, 2024 at 07:20:42PM +0800, [email protected] wrote:

From: Irui Wang <[email protected]>

[ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]

Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi is valid for future use.

Fixes 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
[ Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1 ]
Quoted 3 lines
---
 drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 6 ++++++
 1 file changed, 6 insertions(+)

What changed from v1?

#4 lore raw

V2: Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1

Quoted 1 line · Greg KH

Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1

maintainer
#5 lore raw

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

Quoted 1 line · Bin Lan

V2: Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1

Please always document this in the proper place.

thanks,

greg k-h