mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: qcom-cci: Recover after a target powers down under a running controller
@ 2026-10-20 19:39 Birk Skyum
  2026-10-20 19:39 ` [PATCH 1/2] i2c: qcom-cci: Reset the controller when it resumes Birk Skyum
  2026-10-20 19:39 ` [PATCH 2/2] i2c: qcom-cci: Suspend the controller 50 ms after the last transfer Birk Skyum
  0 siblings, 2 replies; 7+ messages in thread
From: Birk Skyum @ 2026-10-20 19:39 UTC (permalink / raw)
  To: Loic Poulain, Robert Foss, Andi Shyti
  Cc: Bryan O'Donoghue, Vladimir Zapolskiy, Jishnu Prakash,
	Saikiran, Mark Brown, linux-i2c, linux-arm-msm, linux-media,
	linux-kernel

On the Lenovo Yoga Slim 7x (X1E80100) the OV02C10 front camera on CCI1
master 1 fails to start whenever it is opened again within about a
second of being closed. The first register write times out ("master 1
queue 0 timeout") and the stream does not start. Two attempts so far
treated this as a sensor power-up problem. One gave the ov02c10 driver a
longer settle time, the other a minimum off time for the camera rails
through regulator-off-on-delay-us [1]. Neither is needed.

The sensor holds SCL and SDA low while it is powered down. If the CCI
controller stays clocked from then until its next transfer, the master
no longer starts transfers. The queue stays on its first command, no
interrupt arrives, and only the reset in cci_run_queue()'s timeout path
brings it back. A runtime suspend clears the state too, but only when
the power domain collapses, because cci_resume_runtime() does not reset
the controller. With the 1 s autosuspend delay, any power cycle of a
target that is shorter than a second runs into it.

Patch 1 resets the controller on every runtime resume. Patch 2 suspends
it 50 ms after its last transfer.

Tested on the Yoga with the driver from i2c/i2c-next, built as a module
for a 7.2.8-based kernel whose device tree has no off-on delay for the
camera rails. The CCI clock runs at 37.5 MHz there. Starting the camera
with v4l2-ctl after a pause:

  pause          0.05 s  0.1 s  0.2 s  0.5 s  1 s
  failed before   19/20  19/20  19/20  19/20  16/20
  failed after     0/20   0/20   0/20   0/20   0/20

With the series, 150 libcamera starts back to back all started, so the
sensor itself starts fine after a 50 ms pause. The same two changes on
7.2.8's driver, with the CCI clock at 19.2 MHz, gave the same result.

[1] https://lore.kernel.org/all/20261001-regulator-off-on-delay-v4-0-258ba9612da8@oss.qualcomm.com/

Birk Skyum (2):
  i2c: qcom-cci: Reset the controller when it resumes
  i2c: qcom-cci: Suspend the controller 50 ms after the last transfer

 drivers/i2c/busses/i2c-qcom-cci.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

base-commit: bd4a545e4f5dbd5e4dd0064777429813516b8784
-- 
2.53.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-21 19:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 19:39 [PATCH 0/2] i2c: qcom-cci: Recover after a target powers down under a running controller Birk Skyum
2026-10-20 19:39 ` [PATCH 1/2] i2c: qcom-cci: Reset the controller when it resumes Birk Skyum
2026-10-21  7:20   ` Loic Poulain
2026-10-21 19:37     ` Birk Skyum
2026-10-20 19:39 ` [PATCH 2/2] i2c: qcom-cci: Suspend the controller 50 ms after the last transfer Birk Skyum
2026-10-21  7:44   ` Loic Poulain
2026-10-21 19:37     ` Birk Skyum

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®