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 20:06:48 +0800 [thread overview]
Message-ID: <d101876a72e6248c77ee5de0d1dc52687e225629.camel@mediatek.com> (raw)
In-Reply-To: <31992c67-400e-8e14-38c2-4655995886f5@xs4all.nl>
Dear Hans,
Thanks for your suggestion.
On Wed, 2022-05-18 at 13:34 +0200, Hans Verkuil wrote:
>
> On 5/18/22 13:29, yunfei.dong@mediatek.com wrote:
> > 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.
>
> OK, I think this should be stated in the commit log, and also in the
> code
> (see below).
>
> >
> > Best Regards,
> > Yunfei Dong
>
> <snip>
>
> > > > 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");
>
> E.g., either add a comment here or perhaps change the error message
> to:
>
> "ap_inst_addr is NULL, did the SCP hang?"
>
> Or something along those lines.
>
I will change the message in next patch like below.
mtk_v4l2_err("ap_inst_addr is NULL, did the SCP hang or crash?");
> Shouldn't there be a \n at the end of this message as well? Or does
> mtk_v4l2_err add that?
>
mtk_v4l2_err add '\n' in the end.
> Regards,
>
> Hans
>
Best Regards,
Yunfei Dong
> > > > + return;
> > > > + }
> > > > +
> > > > mtk_vcodec_debug(vpu, "+ id=%X", msg->msg_id);
> > > >
> > > > vpu->failure = msg->status;
next prev parent reply other threads:[~2022-05-18 12:07 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
2022-05-18 11:34 ` Hans Verkuil
2022-05-18 12:06 ` yunfei.dong [this message]
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=d101876a72e6248c77ee5de0d1dc52687e225629.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®