From: Paul Kocialkowski <paulk@sys-base.io>
To: sashiko-reviews@lists.linux.dev
Cc: linux-sunxi@lists.linux.dev
Subject: Re: [PATCH 14/16] media: sun6i-isp: Use V4L2 subdev active state
Date: Mon, 18 May 2026 13:57:33 +0200 [thread overview]
Message-ID: <agr-rZexPlvBGkXI@collins> (raw)
In-Reply-To: <20260518114455.5A2D1C2BCB7@smtp.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 3316 bytes --]
Le Mon 18 May 26, 11:44, sashiko-bot@kernel.org a écrit :
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The format for SUN6I_ISP_PROC_PAD_SINK_PARAMS is left uninitialized (zeroed) in sun6i_isp_proc_init_state, which will cause v4l2-compliance failures.
> --
>
> commit a1aac013cb6f860e3fef00fefa14f9e439c4e03c
> Author: Paul Kocialkowski <paulk@sys-base.io>
>
> media: sun6i-isp: Use V4L2 subdev active state
>
> This commit converts the driver to store the active format using the common
> V4L2 subdev active state instead of maintaining a local copy.
>
> > diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c
> > index 46a334b602f19..9073a7f3f8c8c 100644
> > --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c
> > +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_proc.c
>
> [ ... ]
>
> > @@ -259,21 +262,22 @@ sun6i_isp_proc_mbus_format_prepare(struct v4l2_mbus_framefmt *mbus_format)
> > static int sun6i_isp_proc_init_state(struct v4l2_subdev *subdev,
> > struct v4l2_subdev_state *state)
> > {
> > - struct sun6i_isp_device *isp_dev = v4l2_get_subdevdata(subdev);
> > - unsigned int pad = SUN6I_ISP_PROC_PAD_SINK_CSI;
> > - struct v4l2_mbus_framefmt *mbus_format =
> > - v4l2_subdev_state_get_format(state, pad);
> > - struct mutex *lock = &isp_dev->proc.lock;
> > + unsigned int pad;
> >
> > - mutex_lock(lock);
> > + for (pad = 0; pad < subdev->entity.num_pads; pad++) {
> > + struct v4l2_mbus_framefmt *mbus_format;
> >
> > - mbus_format->code = sun6i_isp_proc_formats[0].mbus_code;
> > - mbus_format->width = 1280;
> > - mbus_format->height = 720;
> > + if (pad == SUN6I_ISP_PROC_PAD_SINK_PARAMS)
> > + continue;
>
> Does skipping the initialization for SUN6I_ISP_PROC_PAD_SINK_PARAMS here
> leave its format completely zeroed out?
>
> Because v4l2_subdev_init_finalize() allocates the active state memory using
> kzalloc(), skipping this pad means its format will be left with a media bus
> code of 0, as well as 0 for width and height.
>
> With the get_fmt operation now pointing to the generic v4l2_subdev_get_fmt()
> helper, calling VIDIOC_SUBDEV_G_FMT on the parameters pad will return this
> zeroed format.
Yes, there is no mbus format definition here and everything zeroed out
is fine.
> Since a media bus code of 0 is invalid in V4L2, could this result in
> v4l2-compliance testing failures?
I think it's fine.
Paul
>
> >
> > - sun6i_isp_proc_mbus_format_prepare(mbus_format);
> > + mbus_format = v4l2_subdev_state_get_format(state, pad);
> >
> > - mutex_unlock(lock);
> > + mbus_format->code = sun6i_isp_proc_formats[0].mbus_code;
> > + mbus_format->width = 1280;
> > + mbus_format->height = 720;
> > +
> > + sun6i_isp_proc_mbus_format_prepare(mbus_format);
> > + }
> >
> > return 0;
> > }
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260518102451.417971-1-paulk@sys-base.io?part=14
--
Paul Kocialkowski,
Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/
Expert in multimedia, graphics and embedded hardware support with Linux.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-05-18 11:57 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 10:24 [PATCH 00/16] media: sun6i-csi/isp MC-centric support and cleanups Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 01/16] media: sun6i-csi: bridge: Use V4L2 subdev active state Paul Kocialkowski
2026-05-18 11:15 ` sashiko-bot
2026-07-02 7:38 ` arash golgol
2026-07-08 13:50 ` Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 02/16] media: sun6i-csi: capture: Implement vidioc_enum_framesizes Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 03/16] media: sun6i-mipi-csi2: Use V4L2 subdev active state Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 04/16] media: sun8i-a83t-mipi-csi2: " Paul Kocialkowski
2026-05-18 14:09 ` Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 05/16] media: v4l2-common: Fix NV15_4L4 format info block height Paul Kocialkowski
2026-05-18 11:14 ` sashiko-bot
2026-05-19 15:16 ` Nicolas Dufresne
2026-05-19 20:33 ` Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 06/16] media: v4l2-common: Add missing tiled format info block sizes Paul Kocialkowski
2026-05-19 15:18 ` Nicolas Dufresne
2026-05-19 20:37 ` Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 07/16] media: v4l2-common: Add NV12_16L16 pixel format to v4l2 format info Paul Kocialkowski
2026-05-19 15:22 ` Nicolas Dufresne
2026-05-18 10:24 ` [PATCH 08/16] media: v4l2-common: Add NV12_32L32 " Paul Kocialkowski
2026-05-19 15:23 ` Nicolas Dufresne
2026-05-18 10:24 ` [PATCH 09/16] media: sun6i-csi: Split format validation to a dedicated helper Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 10/16] media: sun6i-csi: Add support for MC-centric format enumeration Paul Kocialkowski
2026-05-27 5:50 ` arash golgol
2026-05-27 7:59 ` Paul Kocialkowski
2026-05-27 11:53 ` arash golgol
2026-05-18 10:24 ` [PATCH 11/16] media: sun6i-csi: Tidy up and unify coding style Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 12/16] media: sun6i-mipi-csi2: Fix parenthesis alignment Paul Kocialkowski
2026-05-18 10:24 ` [PATCH 13/16] media: sun6i-isp: Add dummy params link_validate implementation Paul Kocialkowski
2026-05-25 3:25 ` arash golgol
2026-05-18 10:24 ` [PATCH 14/16] media: sun6i-isp: Use V4L2 subdev active state Paul Kocialkowski
2026-05-18 11:44 ` sashiko-bot
2026-05-18 11:57 ` Paul Kocialkowski [this message]
2026-05-21 9:23 ` arash golgol
2026-05-22 11:15 ` Paul Kocialkowski
2026-05-23 3:15 ` arash golgol
2026-05-18 10:24 ` [PATCH 15/16] media: sun6i-isp: Add support for MC-centric format enumeration Paul Kocialkowski
2026-05-18 11:02 ` sashiko-bot
2026-05-28 7:35 ` arash golgol
2026-05-18 10:24 ` [PATCH 16/16] media: sun6i-isp: Add support for frame size enumeration Paul Kocialkowski
2026-05-23 4:34 ` arash golgol
2026-05-18 12:15 ` [PATCH 00/16] media: sun6i-csi/isp MC-centric support and cleanups Laurent Pinchart
2026-05-18 14:08 ` Paul Kocialkowski
2026-08-03 12:16 ` Ondřej Jirman
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=agr-rZexPlvBGkXI@collins \
--to=paulk@sys-base.io \
--cc=linux-sunxi@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
/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