From: "yunfei.dong@mediatek.com" <yunfei.dong@mediatek.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Alexandre Courbot <acourbot@chromium.org>,
Nicolas Dufresne <nicolas@ndufresne.ca>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Benjamin Gaignard <benjamin.gaignard@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>,
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>,
<linux-mediatek@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v6, 6/7] media: mediatek: vcodec: prevent kernel crash when scp ipi timeout
Date: Wed, 18 May 2022 19:29:15 +0800 [thread overview]
Message-ID: <f26d5225fc8c499226c297ed86feb5ee20e8f3d3.camel@mediatek.com> (raw)
In-Reply-To: <ea9a04fb-368d-daca-96ae-9366253a5e91@xs4all.nl>
Dear Hans,
Thanks for your review.
On Wed, 2022-05-18 at 11:37 +0200, Hans Verkuil wrote:
> Hi Yunfei,
>
> On 5/13/22 11:25, Yunfei Dong wrote:
> > 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.
>
> Is the root cause being addressed as well? Where is the root cause?
> Is it
> in this driver or in the scp (i.e. the remoteproc) driver?
>
> I need a bit more information to decide whether this series is ready
> to
> be merged for 5.20 or not.
>
> Regards,
>
> Hans
>
Vpu will be NUll when scp(micro processor) is hang or crash. Need to
keep kernel works well , so add this patch.
Best Regards,
Yunfei Dong
> >
> > 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>
> > Reviewed-by: Macpaul Lin <macpaul.lin@mediatek.com>
> > ---
> > drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > index 35f4d5583084..1041dd663e76 100644
> > --- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
> > +++ b/drivers/media/platform/mediatek/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;
next prev parent reply other threads:[~2022-05-18 11:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 9:25 [PATCH v6, 0/7] support mt8195 decoder Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 1/7] dt-bindings: media: mediatek: vcodec: Adds decoder dt-bindings for lat soc Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 2/7] media: mediatek: vcodec: Add to support lat soc hardware Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 3/7] dt-bindings: media: mediatek: vcodec: Adds decoder dt-bindings for mt8195 Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 4/7] media: mediatek: vcodec: Adds compatible " Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 5/7] media: mediatek: vcodec: Different codec using different capture format Yunfei Dong
2022-05-13 9:25 ` [PATCH v6, 6/7] media: mediatek: vcodec: prevent kernel crash when scp ipi timeout Yunfei Dong
2022-05-18 9:37 ` Hans Verkuil
2022-05-18 11:29 ` yunfei.dong [this message]
2022-05-18 11:34 ` Hans Verkuil
2022-05-18 12:06 ` yunfei.dong
2022-05-13 9:25 ` [PATCH v6, 7/7] media: mediatek: 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=f26d5225fc8c499226c297ed86feb5ee20e8f3d3.camel@mediatek.com \
--to=yunfei.dong@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=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--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=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=robh+dt@kernel.org \
--cc=stevecho@chromium.org \
--cc=tfiga@google.com \
--cc=tiffany.lin@mediatek.com \
--cc=xiaoyong.lu@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®