From: Macpaul Lin <macpaul.lin@mediatek.com>
To: Yunfei Dong <yunfei.dong@mediatek.com>,
Alexandre Courbot <acourbot@chromium.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
"Tzung-Bi Shih" <tzungbi@chromium.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Tomasz Figa <tfiga@google.com>
Cc: George Sun <george.sun@mediatek.com>,
Xiaoyong Lu <xiaoyong.lu@mediatek.com>,
Hsin-Yi Wang <hsinyi@chromium.org>,
Fritz Koenig <frkoenig@chromium.org>,
Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Daniel Vetter <daniel@ffwll.ch>,
dri-devel <dri-devel@lists.freedesktop.org>,
Irui Wang <irui.wang@mediatek.com>,
Steve Cho <stevecho@chromium.org>, <linux-media@vger.kernel.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<srv_heupstream@mediatek.com>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
Fabien Parent <fparent@baylibre.com>,
Macross Chen <macross.chen@mediatek.com>
Subject: Re: [PATCH v1, 6/8] media: mtk-vcodec: prevent kernel crash when scp ipi timeout
Date: Thu, 27 Jan 2022 11:15:11 +0800 [thread overview]
Message-ID: <220f3e0a-3203-6f6f-8cc6-b5f24bc1feed@mediatek.com> (raw)
In-Reply-To: <20220127025544.10854-7-yunfei.dong@mediatek.com>
On 1/27/22 10:55 AM, Yunfei Dong wrote:
> From: Tinghan Shen <tinghan.shen@mediatek.com>
>
> When SCP timeout during playing video, kernel crashes with following
> message. It's caused by accessing NULL pointer in vpu_dec_ipi_handler.
> This patch doesn't solve the root cause of NULL pointer, but merely
> prevent kernel crashed when encounter the NULL pointer.
>
> After applied this patch, kernel keeps alive, only the video player turns
> to green screen.
>
> [67242.065474] pc : vpu_dec_ipi_handler+0xa0/0xb20 [mtk_vcodec_dec]
> [67242.065485] [MTK_V4L2] level=0 fops_vcodec_open(),334:
> 18000000.vcodec_dec decoder [135]
> [67242.065523] lr : scp_ipi_handler+0x11c/0x244 [mtk_scp]
> [67242.065540] sp : ffffffbb4207fb10
> [67242.065557] x29: ffffffbb4207fb30 x28: ffffffd00a1d5000
> [67242.065592] x27: 1ffffffa0143aa24 x26: 0000000000000000
> [67242.065625] x25: dfffffd000000000 x24: ffffffd0168bfdb0
> [67242.065659] x23: 1ffffff76840ff74 x22: ffffffbb41fa8a88
> [67242.065692] x21: ffffffbb4207fb9c x20: ffffffbb4207fba0
> [67242.065725] x19: ffffffbb4207fb98 x18: 0000000000000000
> [67242.065758] x17: 0000000000000000 x16: ffffffd042022094
> [67242.065791] x15: 1ffffff77ed4b71a x14: 1ffffff77ed4b719
> [67242.065824] x13: 0000000000000000 x12: 0000000000000000
> [67242.065857] x11: 0000000000000000 x10: dfffffd000000001
> [67242.065890] x9 : 0000000000000000 x8 : 0000000000000002
> [67242.065923] x7 : 0000000000000000 x6 : 000000000000003f
> [67242.065956] x5 : 0000000000000040 x4 : ffffffffffffffe0
> [67242.065989] x3 : ffffffd043b841b8 x2 : 0000000000000000
> [67242.066021] x1 : 0000000000000010 x0 : 0000000000000010
> [67242.066055] Call trace:
> [67242.066092] vpu_dec_ipi_handler+0xa0/0xb20 [mtk_vcodec_dec
> 12220d230d83a7426fc38c56b3e7bc6066955bae]
> [67242.066119] scp_ipi_handler+0x11c/0x244 [mtk_scp
> 8fb69c2ef141dd3192518b952b65aba35627b8bf]
> [67242.066145] mt8192_scp_irq_handler+0x70/0x128 [mtk_scp
> 8fb69c2ef141dd3192518b952b65aba35627b8bf]
> [67242.066172] scp_irq_handler+0xa0/0x114 [mtk_scp
> 8fb69c2ef141dd3192518b952b65aba35627b8bf]
> [67242.066200] irq_thread_fn+0x84/0xf8
> [67242.066220] irq_thread+0x170/0x1ec
> [67242.066242] kthread+0x2f8/0x3b8
> [67242.066264] ret_from_fork+0x10/0x30
> [67242.066292] Code: 38f96908 35003628 91004340 d343fc08 (38f96908)
>
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> ---
> drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
> index 35f4d5583084..1041dd663e76 100644
> --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
> +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
> @@ -91,6 +91,11 @@ static void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
> struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
> (unsigned long)msg->ap_inst_addr;
>
> + if (!vpu) {
> + mtk_v4l2_err("ap_inst_addr is NULL");
> + return;
> + }
> +
> mtk_vcodec_debug(vpu, "+ id=%X", msg->msg_id);
>
> vpu->failure = msg->status;
>
Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
Regards,
Macpaul Lin
next prev parent reply other threads:[~2022-01-27 3:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 2:55 [PATCH v1, 0/8] support mt8195 decoder Yunfei Dong
2022-01-27 2:55 ` [PATCH v1, 1/8] dt-bindings: media: mtk-vcodec: Adds decoder dt-bindings for lat soc Yunfei Dong
2022-01-27 2:55 ` [PATCH v1, 2/8] media: mtk-vcodec: Add to support lat soc hardware Yunfei Dong
2022-01-27 2:55 ` [PATCH v1, 3/8] dt-bindings: media: mtk-vcodec: Adds decoder dt-bindings for mt8195 Yunfei Dong
2022-01-27 3:13 ` Macpaul Lin
2022-01-27 2:55 ` [PATCH v1, 4/8] media: mtk-vcodec: Adds compatible " Yunfei Dong
2022-01-27 3:13 ` Macpaul Lin
2022-01-27 2:55 ` [PATCH v1, 5/8] media: mtk-vcodec: Different codec using different capture format Yunfei Dong
2022-01-27 2:55 ` [PATCH v1, 6/8] media: mtk-vcodec: prevent kernel crash when scp ipi timeout Yunfei Dong
2022-01-27 3:15 ` Macpaul Lin [this message]
2022-01-27 2:55 ` [PATCH v1, 7/8] media: uapi: Init VP9 stateless decode params Yunfei Dong
2022-01-27 9:23 ` Chen-Yu Tsai
2022-01-28 3:28 ` yunfei.dong
2022-01-27 10:35 ` AngeloGioacchino Del Regno
2022-01-28 3:29 ` yunfei.dong
2022-01-27 2:55 ` [PATCH v1, 8/8] media: mtk-vcodec: Add to support H264 inner racing mode Yunfei Dong
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=220f3e0a-3203-6f6f-8cc6-b5f24bc1feed@mediatek.com \
--to=macpaul.lin@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=acourbot@chromium.org \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=dafna.hirschfeld@collabora.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fparent@baylibre.com \
--cc=frkoenig@chromium.org \
--cc=george.sun@mediatek.com \
--cc=hsinyi@chromium.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=irui.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=macross.chen@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=srv_heupstream@mediatek.com \
--cc=stevecho@chromium.org \
--cc=tfiga@google.com \
--cc=tiffany.lin@mediatek.com \
--cc=tzungbi@chromium.org \
--cc=xiaoyong.lu@mediatek.com \
--cc=yunfei.dong@mediatek.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®