From: sashiko-bot@kernel.org
To: "Sergey Lebedev" <lsa.uz@pm.me>
Cc: devicetree@vger.kernel.org, media-ci@linuxtv.org,
conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 2/3] media: i2c: Add Sony IMX681 sensor driver
Date: Fri, 02 Oct 2026 09:14:50 +0000 [thread overview]
Message-ID: <20261002091451.1476A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261002082537.74084-3-lsa.uz@pm.me>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] media: imx681: data race when reading controls in TRY state
--
commit a33b99a3eba0fc3b30bb7afedc0eb847da781102
Author: Andre Gilerson <andre.gilerson@gmail.com>
media: i2c: Add Sony IMX681 sensor driver
This commit adds a V4L2 sub-device driver for the Sony IMX681 sensor. It
supports 10-bit Bayer formats over a two-lane CSI-2 bus with a single
3844x2640 mode at 30 fps, along with various controls including flips.
> diff --git a/drivers/media/i2c/imx681.c b/drivers/media/i2c/imx681.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/media/i2c/imx681.c
[ ... ]
> +static u32 imx681_get_format_code(struct imx681 *imx681)
> +{
> + return imx681_mbus_codes[(imx681->vflip->val ? 2 : 0) |
> + (imx681->hflip->val ? 1 : 0)];
> +}
[Severity: Medium]
Is there a potential data race here when reading the control values
during TRY state operations?
When a userspace process calls VIDIOC_SUBDEV_ENUM_MBUS_CODE or
VIDIOC_SUBDEV_S_FMT with V4L2_SUBDEV_FORMAT_TRY, the V4L2 core locks the
file handle's TRY state, but not the control handler. Concurrently, if
another thread calls VIDIOC_S_CTRL to modify V4L2_CID_HFLIP or
V4L2_CID_VFLIP, it locks the control handler and mutates ctrl->val.
Because this code reads imx681->vflip->val and imx681->hflip->val without
acquiring imx681->ctrl_handler.lock, this can lead to KCSAN warnings and
incorrect media bus code reporting due to stale reads.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261002082537.74084-1-lsa.uz@pm.me?part=2
next prev parent reply other threads:[~2026-10-02 9:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 8:25 [PATCH v8 0/3] Add support for the Sony IMX681 camera sensor Sergey Lebedev
2026-10-02 8:25 ` [PATCH v8 1/3] dt-bindings: media: Add Sony IMX681 Sergey Lebedev
2026-10-02 8:26 ` [PATCH v8 2/3] media: i2c: Add Sony IMX681 sensor driver Sergey Lebedev
2026-10-02 9:14 ` sashiko-bot [this message]
2026-10-02 9:53 ` Sergey Lebedev
2026-10-02 8:26 ` [PATCH v8 3/3] media: ipu-bridge: Add Sony IMX681 Sergey Lebedev
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=20261002091451.1476A1F000FF@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox