From: sashiko-bot@kernel.org
To: "Armandas Kvietkus" <armandas.kvietkus@proton.me>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
media-ci@linuxtv.org
Subject: Re: [PATCH v6 2/2] media: i2c: Add Samsung S5K3T2 image sensor driver
Date: Fri, 20 Nov 2026 18:38:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-225853@kernel.org> (raw)
In-Reply-To: <20261120-upstream-s5k3t2-v6-2-dd345fa4201c@proton.me>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] media: i2c: s5k3t2: update pad format code on flip in
s5k3t2_set_ctrl()
--
commit 85ec713a348e49278df044a3a69e78e7c8ca64be
Author: Armandas Kvietkus <armandas.kvietkus@proton.me>
media: i2c: Add Samsung S5K3T2 image sensor driver
This commit adds a V4L2 subdevice driver for the Samsung S5K3T2 20 Mpixel
CMOS image sensor supporting three RAW10 modes on four MIPI D-PHY lanes.
> diff --git a/drivers/media/i2c/s5k3t2.c b/drivers/media/i2c/s5k3t2.c
> new file mode 100644
> index 0000000000000..9b5be8b4e0067
> --- /dev/null
> +++ b/drivers/media/i2c/s5k3t2.c
> @@ -0,0 +1,1365 @@
[ ... ]
> +static int s5k3t2_set_ctrl(struct v4l2_ctrl *ctrl)
> +{
> + struct s5k3t2 *s5k3t2 = container_of_const(ctrl->handler, struct s5k3t2,
> + ctrl_handler);
> + const struct v4l2_mbus_framefmt *fmt;
> + struct v4l2_subdev_state *state;
> + s64 exposure_max, exposure_def;
> + int ret;
> +
> + state = v4l2_subdev_get_locked_active_state(&s5k3t2->sd);
> + fmt = v4l2_subdev_state_get_format(state, 0);
> +
> + if (ctrl->id == V4L2_CID_LINK_FREQ)
> + return s5k3t2_set_link_freq(s5k3t2, state, ctrl->val);
> +
> + if (ctrl->id == V4L2_CID_VBLANK) {
> + exposure_max = fmt->height + ctrl->val - S5K3T2_EXPOSURE_MARGIN;
> + exposure_def = min(s5k3t2->exposure->default_value,
> + exposure_max);
> + ret = __v4l2_ctrl_modify_range(s5k3t2->exposure,
> + s5k3t2->exposure->minimum,
> + exposure_max,
> + s5k3t2->exposure->step,
> + exposure_def);
> + if (ret)
> + return ret;
> + }
> +
> + if (!pm_runtime_get_if_active(s5k3t2->dev))
> + return 0;
> +
> + switch (ctrl->id) {
> + case V4L2_CID_ANALOGUE_GAIN:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_AGAIN,
> + ctrl->val << S5K3T2_AGAIN_SHIFT, NULL);
> + break;
> + case V4L2_CID_EXPOSURE:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_EXPOSURE,
> + ctrl->val, NULL);
> + break;
> + case V4L2_CID_HBLANK:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_HTS,
> + fmt->width + ctrl->val, NULL);
> + break;
> + case V4L2_CID_VBLANK:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_VTS,
> + fmt->height + ctrl->val, NULL);
> + break;
> + case V4L2_CID_TEST_PATTERN:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_TEST_PATTERN,
> + ctrl->val, NULL);
> + break;
> + case V4L2_CID_HFLIP:
> + ret = cci_write(s5k3t2->regmap, S5K3T2_REG_ORIENTATION,
> + (s5k3t2->hflip->val ? S5K3T2_HFLIP : 0) |
> + (s5k3t2->vflip->val ? S5K3T2_VFLIP : 0), NULL);
> + break;
[Severity: Medium]
Should s5k3t2_set_ctrl() update fmt->code = s5k3t2_get_format_code(s5k3t2) in
the active subdev state when V4L2_CID_HFLIP is set (before the runtime PM
check)?
Both hflip and vflip carry V4L2_CTRL_FLAG_MODIFY_LAYOUT and change the Bayer
code returned by s5k3t2_enum_mbus_code(), but without updating fmt->code in
the active state, v4l2_subdev_get_fmt() and v4l2_subdev_link_validate() see a
stale media bus format code after a flip control change.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-upstream-s5k3t2-v6-0-dd345fa4201c@proton.me?part=2
prev parent reply other threads:[~2026-11-20 18:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 18:04 [PATCH v6 0/2] media: i2c: Samsung S5K3T2 image sensor Armandas Kvietkus
2026-11-20 18:04 ` Armandas Kvietkus via B4 Relay
2026-11-20 18:04 ` [PATCH v6 1/2] dt-bindings: media: i2c: Add " Armandas Kvietkus
2026-11-20 18:04 ` Armandas Kvietkus via B4 Relay
2026-11-20 18:04 ` [PATCH v6 2/2] media: i2c: Add Samsung S5K3T2 image sensor driver Armandas Kvietkus
2026-11-20 18:04 ` Armandas Kvietkus via B4 Relay
2026-11-20 18:38 ` sashiko-bot [this message]
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=sashiko-outbox-225853@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=armandas.kvietkus@proton.me \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=media-ci@linuxtv.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.