Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dave Stevenson" <dave.stevenson@raspberrypi.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 20/21] media: imx355: Switch to using the subdev state
Date: Wed, 15 Jul 2026 12:13:49 +0000	[thread overview]
Message-ID: <20260715121349.BFE301F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260715-media-imx355-v4-20-f7f966fb9ffd@raspberrypi.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] v4l2_subdev_get_fmt returns a stale format code after HFLIP/VFLIP changes, breaking frame size enumeration.
--

--- Patch [20]: [PATCH v4 20/21] media: imx355: Switch to using the subdev state ---
commit 742fe3da9be2474160e24d38a786d4c4d792ff1f
Author: Dave Stevenson <dave.stevenson@raspberrypi.com>

media: imx355: Switch to using the subdev state

This commit switches the imx355 driver to use the V4L2 subdev state
for managing crop and format rather than handling them within the
driver state.

> diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c
> index 0462e0feee362..97f4594f7ed9a 100644
> --- a/drivers/media/i2c/imx355.c
> +++ b/drivers/media/i2c/imx355.c

[ ... ]

> @@ -1034,7 +960,7 @@ static const struct v4l2_subdev_video_ops imx355_video_ops = {
>  
>  static const struct v4l2_subdev_pad_ops imx355_pad_ops = {
>  	.enum_mbus_code = imx355_enum_mbus_code,
> -	.get_fmt = imx355_get_pad_format,
> +	.get_fmt = v4l2_subdev_get_fmt,

[Severity: High]
Does switching to v4l2_subdev_get_fmt return a stale format code after
HFLIP/VFLIP changes?

In imx355_set_ctrl(), the hardware orientation and logically the Bayer
format change when HFLIP or VFLIP are updated:

imx355_set_ctrl()
    ...
    case V4L2_CID_HFLIP:
    case V4L2_CID_VFLIP:
        ret = cci_write(imx355->regmap, IMX355_REG_ORIENTATION,
                        imx355->hflip->val | imx355->vflip->val << 1,
                        NULL);
        break;

However, the active state's format code is not updated here. Because
get_fmt now relies on v4l2_subdev_get_fmt instead of the dynamically
evaluated imx355_get_pad_format(), VIDIOC_SUBDEV_G_FMT returns the
stale format.

This appears to break frame size enumeration, as
VIDIOC_SUBDEV_ENUM_FRAME_SIZE will evaluate the correct format code and
reject the stale code with -EINVAL:

imx355_enum_frame_size()
    if (fse->code != imx355_get_format_code(imx355)) {
        return -EINVAL;
    }

Should the active subdev state format be updated when the orientation
controls change?

>  	.set_fmt = imx355_set_pad_format,
>  	.enum_frame_size = imx355_enum_frame_size,
>  	.get_selection = imx355_get_selection,

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260715-media-imx355-v4-0-f7f966fb9ffd@raspberrypi.com?part=20

  reply	other threads:[~2026-07-15 12:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 11:43 [PATCH v4 00/21] media/imx355: General code cleanups, and adding support for 2 lane operation Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 01/21] media: imx355: Avoid calling imx355_power_off twice in error path Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 02/21] media: i2c: imx355: Add support for 24 MHz external clock Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 03/21] dt-bindings: media: imx355: Allow 2 CSI2 data lane output Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 04/21] media: imx355: Remove duplicated registers from the mode tables Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 05/21] media: imx355: Remove setting FRM_LENGTH_LINES in the mode regs Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 06/21] media: imx355: Programmatically set the crop parameters for each mode Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 07/21] media: imx355: Set register LINE_LENGTH_PCK programmatically Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 08/21] media: imx355: Set binning mode registers programmatically Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 09/21] media: imx355: Remove link_freq_index from each mode as ununsed Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 10/21] media: imx355: pixel_rate never changes, so don't recompute Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 11/21] media: imx355: Remove redundant fll_min, and implement fixed offset Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 12/21] media: imx355: Add support for get_selection Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 13/21] media: imx355: Use pm_runtime autosuspend_delay Dave Stevenson
2026-07-15 12:03   ` sashiko-bot
2026-07-15 11:43 ` [PATCH v4 14/21] media: imx355: Convert to new CCI register access helpers Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 15/21] media: imx355: Set the colorspace in the format Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 16/21] media: imx355: Define the exposure offset, and use that define Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 17/21] media: imx355: Use NULL ctrl_ops for HBLANK as it is a read-only control Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 18/21] media: imx355: Compute link frequency from PLL setup Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 19/21] media: imx355: Support 2 lane readout Dave Stevenson
2026-07-15 11:43 ` [PATCH v4 20/21] media: imx355: Switch to using the subdev state Dave Stevenson
2026-07-15 12:13   ` sashiko-bot [this message]
2026-07-15 11:43 ` [PATCH v4 21/21] media: imx355: Remove storing cur_mode in the state Dave Stevenson

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=20260715121349.BFE301F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --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