public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
@ 2024-12-07 11:20 bin.lan.cn
  2024-12-07 13:25 ` Sasha Levin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: bin.lan.cn @ 2024-12-07 11:20 UTC (permalink / raw)
  To: stable, irui.wang

From: Irui Wang <irui.wang@mediatek.com>

[ 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")

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[ Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1 ]
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
 drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
index df309e8e9379..af3fc89b6cc5 100644
--- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
+++ b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
@@ -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;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-07 11:20 [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
@ 2024-12-07 13:25 ` Sasha Levin
  2024-12-11  8:13 ` Greg KH
  2024-12-11  8:13 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2024-12-07 13:25 UTC (permalink / raw)
  To: stable; +Cc: bin.lan.cn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 59d438f8e02ca641c58d77e1feffa000ff809e9f

WARNING: Author mismatch between patch and upstream commit:
Backport author: bin.lan.cn@eng.windriver.com
Commit author: Irui Wang <irui.wang@mediatek.com>


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   |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-07 11:20 [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
  2024-12-07 13:25 ` Sasha Levin
@ 2024-12-11  8:13 ` Greg KH
  2024-12-11  8:13 ` Greg KH
  2 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2024-12-11  8:13 UTC (permalink / raw)
  To: bin.lan.cn; +Cc: stable, irui.wang

On Sat, Dec 07, 2024 at 07:20:42PM +0800, bin.lan.cn@eng.windriver.com wrote:
> From: Irui Wang <irui.wang@mediatek.com>
> 
> [ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]

Please cc: all relevant people on backports.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-07 11:20 [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
  2024-12-07 13:25 ` Sasha Levin
  2024-12-11  8:13 ` Greg KH
@ 2024-12-11  8:13 ` Greg KH
  2024-12-11  8:21   ` Bin Lan
  2 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2024-12-11  8:13 UTC (permalink / raw)
  To: bin.lan.cn; +Cc: stable, irui.wang

On Sat, Dec 07, 2024 at 07:20:42PM +0800, bin.lan.cn@eng.windriver.com wrote:
> From: Irui Wang <irui.wang@mediatek.com>
> 
> [ 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")
> 
> Signed-off-by: Irui Wang <irui.wang@mediatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> [ Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1 ]
> Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
> ---
>  drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 6 ++++++
>  1 file changed, 6 insertions(+)

What changed from v1?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-11  8:13 ` Greg KH
@ 2024-12-11  8:21   ` Bin Lan
  2024-12-11  8:31     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Bin Lan @ 2024-12-11  8:21 UTC (permalink / raw)
  To: Greg KH, bin.lan.cn; +Cc: stable, irui.wang

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

On 12/11/24 16:13, Greg KH wrote:
> Replace mtk_vdec_err with mtk_vcodec_err to make it work on 6.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-11  8:21   ` Bin Lan
@ 2024-12-11  8:31     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2024-12-11  8:31 UTC (permalink / raw)
  To: Bin Lan; +Cc: bin.lan.cn, stable, irui.wang

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

On Wed, Dec 11, 2024 at 04:21:33PM +0800, Bin Lan wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-11  8:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-07 11:20 [PATCH 6.1 v2] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
2024-12-07 13:25 ` Sasha Levin
2024-12-11  8:13 ` Greg KH
2024-12-11  8:13 ` Greg KH
2024-12-11  8:21   ` Bin Lan
2024-12-11  8:31     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox