Re: [PATCH v8 2/3] media: i2c: Add Sony IMX681 sensor driver

From: Sergey Lebedev

Date: Fri Oct 02 2026 - 05:56:40 EST


Sashiko's review of this patch [1] went to devicetree, not linux-media. It
asks whether the flip controls are read here without the control handler
lock:

> 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.

The TRY state's lock is the control handler's lock. The driver sets
sd.state_lock to ctrl_handler.lock before v4l2_subdev_init_finalize(), and
subdev_fh_init() allocates each TRY state with sd->state_lock, so these
ioctls hold the same mutex as S_CTRL. No change needed.

[1] https://lore.kernel.org/all/20261002091451.1476A1F000FF@xxxxxxxxxxxxxxx/

Sergey