From: sashiko-bot@kernel.org
To: "Sergey Lebedev" <lsa.uz@pm.me>
Cc: media-ci@linuxtv.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 2/3] media: i2c: Add Sony IMX681 sensor driver
Date: Wed, 09 Sep 2026 19:52:19 +0000 [thread overview]
Message-ID: <20260909195219.D8D531F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260909193953.86192-3-lsa.uz@pm.me>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] V4L2 controls are silently ignored when CONFIG_PM is disabled.
--
commit 399d495a390ace2e779563ec50b4c97d653a6b76
Author: Andre Gilerson <andre.gilerson@gmail.com>
media: i2c: Add Sony IMX681 sensor driver
The Sony IMX681 is the user-facing camera on the Microsoft Surface Pro 11
for Business (Intel Lunar Lake, IPU7), where it is enumerated as ACPI
device SONY0681. Without a driver the camera does not appear at all.
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index 5c52007f9cbeb..5f7b0d22c8f07 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -310,6 +310,16 @@ config VIDEO_IMX678
> To compile this driver as a module, choose M here: the
> module will be called imx678.
>
> +config VIDEO_IMX681
> + tristate "Sony IMX681 sensor support"
> + select V4L2_CCI_I2C
> + help
> + This is a Video4Linux2 sensor driver for the Sony
> + IMX681 camera.
> +
> + To compile this driver as a module, choose M here: the
> + module will be called imx681.
> +
[ ... ]
> diff --git a/drivers/media/i2c/imx681.c b/drivers/media/i2c/imx681.c
> new file mode 100644
> index 0000000000000..bdaf435541a82
> --- /dev/null
> +++ b/drivers/media/i2c/imx681.c
> @@ -0,0 +1,880 @@
[ ... ]
> +static int imx681_set_ctrl(struct v4l2_ctrl *ctrl)
> +{
> + struct imx681 *imx681 = container_of(ctrl->handler, struct imx681,
> + ctrl_handler);
> + s64 exposure_max;
> + int ret = 0;
> +
> + /* Update exposure max when VBLANK changes (even when not streaming) */
> + if (ctrl->id == V4L2_CID_VBLANK) {
> + exposure_max = IMX681_HEIGHT + ctrl->val - IMX681_EXPOSURE_OFFSET;
> + __v4l2_ctrl_modify_range(imx681->exposure,
> + IMX681_EXPOSURE_MIN, exposure_max,
> + 1, IMX681_EXPOSURE_DEFAULT);
> + }
> +
> + /*
> + * Only apply controls to hardware when streaming. The call returns 1
> + * having taken a reference, 0 if the device is not active, or -EINVAL
> + * if runtime PM is disabled - and in that last case no reference is
> + * taken, so it must not reach the pm_runtime_put() below.
> + */
> + if (pm_runtime_get_if_active(imx681->dev) <= 0)
> + return 0;
[Severity: Medium]
When the driver is built without CONFIG_PM, pm_runtime_get_if_active()
returns -EINVAL. Does this code misinterpret that error code as the device
being inactive?
Since VIDEO_IMX681 doesn't select or depend on PM in Kconfig, returning 0
here when pm_runtime_get_if_active() returns -EINVAL will silently ignore
all V4L2 control writes (exposure, gain, blanking, test pattern) when the
kernel is compiled without CONFIG_PM.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909193953.86192-1-lsa.uz@pm.me?part=2
next prev parent reply other threads:[~2026-09-09 19:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 19:39 [PATCH v2 0/3] media: Add support for the Sony IMX681 Sergey Lebedev
2026-09-09 19:40 ` [PATCH v2 1/3] dt-bindings: media: Add " Sergey Lebedev
2026-09-09 19:40 ` [PATCH v2 2/3] media: i2c: Add Sony IMX681 sensor driver Sergey Lebedev
2026-09-09 19:52 ` sashiko-bot [this message]
2026-09-09 20:35 ` Sergey Lebedev
2026-09-09 19:40 ` [PATCH v2 3/3] media: ipu-bridge: Add Sony IMX681 Sergey Lebedev
2026-09-09 19:52 ` sashiko-bot
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=20260909195219.D8D531F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lsa.uz@pm.me \
--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.