From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
kernel@collabora.com,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: [PATCH v5 5/7] media: mediatek: vcodec: Read HW active status from syscon
Date: Tue, 25 Jul 2023 16:44:08 -0400 [thread overview]
Message-ID: <b5ba26b8-7c03-4ead-97ff-8ee3ae0efa26@notapiano> (raw)
In-Reply-To: <b5fd2dff-14a5-3ad8-9698-d1a50f4516fa@xs4all.nl>
On Tue, Jul 25, 2023 at 12:15:03PM +0200, Hans Verkuil wrote:
> Hi Nicolas,
>
> On 30/06/2023 17:14, Nícolas F. R. A. Prado wrote:
> > Remove the requirement of a VDEC_SYS reg iospace for both MT8173 and
> > MT8183. To achieve that, rely on a vdecsys syscon to be passed through
> > the DT, and use it to directly read the VDEC_HW_ACTIVE bit during IRQ
> > handling to check whether the HW is active. Also update the VP8 stateful
> > decoder to use the syscon, if present, for writes to VDEC_SYS.
> >
> > The old behavior is still present when reg-names aren't supplied, as
> > to keep backward compatibility.
> >
> > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> >
> > ---
> >
> > Changes in v5:
> > - Added explicit linux/bitfield.h include for FIELD_GET(), following
> > 0day report
> >
> > Changes in v4:
> > - Added new helper and updated VP8 stateful decoder to use it, so the
> > syscon can also be used by mt8173
> > - Made handling cleaner
> > - Reworded commit
> >
> > Changes in v3:
> > - Switched handling of VDEC_HW_ACTIVE to use a syscon instead of the
> > 'active' clock
> > - Reworded commit
> > - Removed changes to subdev part of driver, since they aren't used by
> > MT8183
> >
> > .../mediatek/vcodec/mtk_vcodec_dec_drv.c | 77 ++++++++++++++++---
> > .../platform/mediatek/vcodec/mtk_vcodec_drv.h | 1 +
> > .../mediatek/vcodec/mtk_vcodec_util.c | 15 ++++
> > .../mediatek/vcodec/mtk_vcodec_util.h | 2 +
> > .../mediatek/vcodec/vdec/vdec_vp8_if.c | 10 +--
> > 5 files changed, 87 insertions(+), 18 deletions(-)
>
> This patch introduced this new smatch error:
>
> drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:143 mtk_vcodec_get_reg_bases() error: buffer overflow 'mtk_dec_reg_names' 11 <= 11
>
> I think it is due to:
>
> if (reg_num <= 0 || reg_num > NUM_MAX_VDEC_REG_BASE) {
>
> in mtk_vcodec_get_reg_bases(): the '>' should probably be '>='.
>
> Can you post a follow-up patch fixing this?
Hi Hans,
sorry about that, and thanks for noticing it.
I've just sent the fix:
https://lore.kernel.org/all/20230725204043.569799-1-nfraprado@collabora.com
Thanks,
Nícolas
next prev parent reply other threads:[~2023-07-25 20:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-30 15:14 [PATCH v5 0/7] Enable decoder for mt8183 Nícolas F. R. A. Prado
2023-06-30 15:14 ` [PATCH v5 1/7] media: dt-bindings: mediatek,vcodec: Allow single clock " Nícolas F. R. A. Prado
2023-06-30 15:14 ` [PATCH v5 2/7] media: dt-bindings: mediatek,vcodec: Don't require assigned-clocks Nícolas F. R. A. Prado
2023-06-30 15:14 ` [PATCH v5 3/7] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS register space Nícolas F. R. A. Prado
2023-07-02 10:30 ` Krzysztof Kozlowski
2023-06-30 15:14 ` [PATCH v5 4/7] media: mediatek: vcodec: Define address for VDEC_HW_ACTIVE Nícolas F. R. A. Prado
2023-06-30 15:14 ` [PATCH v5 5/7] media: mediatek: vcodec: Read HW active status from syscon Nícolas F. R. A. Prado
2023-07-21 11:44 ` Hans Verkuil
2023-07-21 14:52 ` Nícolas F. R. A. Prado
2023-07-25 10:15 ` Hans Verkuil
2023-07-25 20:44 ` Nícolas F. R. A. Prado [this message]
2023-06-30 15:14 ` [PATCH v5 6/7] arm64: dts: mediatek: mt8173: Drop VDEC_SYS reg from decoder Nícolas F. R. A. Prado
2023-07-26 19:12 ` Nícolas F. R. A. Prado
2023-06-30 15:14 ` [PATCH v5 7/7] arm64: dts: mediatek: mt8183: Add decoder Nícolas F. R. A. Prado
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=b5ba26b8-7c03-4ead-97ff-8ee3ae0efa26@notapiano \
--to=nfraprado@collabora.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@collabora.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=tiffany.lin@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®