From: Fernando Rimoli <fernandorimoli11@gmail.com>
To: Benjamin Mugnier <benjamin.mugnier@foss.st.com>,
Sylvain Petinot <sylvain.petinot@foss.st.com>
Cc: Fernando Rimoli <fernandorimoli11@gmail.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hans@jjverkuil.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] media: i2c: vd55g1: Two control fixes
Date: Thu, 5 Nov 2026 00:49:03 +0000 [thread overview]
Message-ID: <20261105004907.150545-1-fernandorimoli11@gmail.com> (raw)
1/2 marks the auto exposure lock and bias controls inactive rather than
grabbed in manual exposure mode. It is unchanged; Sakari's question on
it is answered on v2.
2/2 replaces v2's hand-written event ops, as Sakari asked: it
initialises the controls before v4l2_subdev_init_finalize(), which
enables control events. The same order fixes a locking bug the driver
has had since it was added: the state lock was set before the control
handler lock existed, so the two were separate mutexes. Moving the
finalise alone deadlocks the first stream start, because
vd55g1_grab_ctrls() then takes the control handler lock a second time,
so 2/2 also switches it to __v4l2_ctrl_grab(). 2/2 does not depend on
1/2.
Because of the locking bug, 2/2 carries Fixes and Cc: stable, unlike v2.
Benjamin, drop them if you would rather not have it backported.
Changes since v2:
- 2/2: new approach, see above (Sakari)
Testing. I do not have a VD55G1, so this was tested on the VD55G0 of a
Surface Pro 9 (IPU6) through an out-of-tree driver derived from vd55g1.
It is identical in the code 2/2 touches, apart from one more
format-dependent control (pixel rate). A test-only print in s_ctrl()
compared the two locks:
- before 2/2, VIDIOC_S_CTRL ran s_ctrl() with only the control lock
held, and setting the active format and stream on ran it with only
the state lock held;
- with 2/2 they are one lock, held in all three cases;
- without the __v4l2_ctrl_grab() change, the first stream start hung in
vd55g1_grab_ctrls(), blocked on the mutex it already held.
The controls at probe and after a format change match the unpatched
driver, apart from the default of that driver's pixel rate control,
which my port of 2/2 left at its placeholder. The flip and test pattern
controls are grabbed while streaming and released after. R8 644x604, R10
and R10_CSI2P 640x480 streamed 90 of 90 frames, and five start/stop
cycles were clean. v4l2-compliance on the subdev gives the same results
as with v2, in both exposure modes, and control events pass. The kernel
here has no lockdep, hence the print.
v2: https://lore.kernel.org/linux-media/20261101195006.220657-1-fernandorimoli11@gmail.com/
v1: https://lore.kernel.org/linux-media/20261025154031.27083-1-fernandorimoli11@gmail.com/
Fernando Rimoli (2):
media: i2c: vd55g1: Mark the AE lock and bias controls inactive in
manual mode
media: i2c: vd55g1: Use the control handler lock for the subdev state
drivers/media/i2c/vd55g1.c | 65 ++++++++++++++++++++------------------
1 file changed, 35 insertions(+), 30 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.43.0
next reply other threads:[~2026-11-05 0:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 0:49 Fernando Rimoli [this message]
2026-11-05 0:49 ` [PATCH v3 1/2] media: i2c: vd55g1: Mark the AE lock and bias controls inactive in manual mode Fernando Rimoli
2026-11-05 0:49 ` [PATCH v3 2/2] media: i2c: vd55g1: Use the control handler lock for the subdev state Fernando Rimoli
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=20261105004907.150545-1-fernandorimoli11@gmail.com \
--to=fernandorimoli11@gmail.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=hans@jjverkuil.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sylvain.petinot@foss.st.com \
/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
all inboxes | Powered by JetHome®