Update:

https://lore.kernel.org/linux-
media/[email protected]/T/#t

- Summary of Findings
The camera initialization failure on the Lenovo Yoga Slim 7x (Snapdragon X 
Elite) is caused by a hardware brownout on the DOVDD/AVDD rails during rapid 
power cycling.

- Root Cause Analysis
1. **Passive Discharge:** The regulator rails for the OV02C10 sensor lack 
active discharge (or the mechanism to enable it via RPMh/PMIC is currently 
unsupported/blocked in Mainline).
2. **Brownout Threshold:** Measurements indicate the rail requires ~2.3 seconds 
to discharge from 2.8V to a safe 0V (passive leakage).
3. **The Failure:** If the camera is closed and re-opened within <2.0 seconds, 
the sensor logic enters an indeterminate state (I2C responds, but the 
analog/CSI-2 block fails to stream), resulting in a "Connection Timed Out" 
error.

- Fix Strategy (Current Working Setup)
I have stabilized the camera 100% in my local tree using the following 
combination:
1. **Race Condition Fix:** Corrected the power-on sequence in `ov02c10.c` to 
match the datasheet (handling reset/power pins correctly).
2. **Regulator Constraint:** Added `regulator-off-on-delay-us = <2300000>;` to 
the PMIC rail definition in Device Tree. This forces the kernel to honor the 
physical discharge time.
3. **Autosuspend:** Enabled Runtime PM Autosuspend (1000ms delay) in the 
driver. This masks the long regulator delay during normal usage by keeping the 
sensor powered for 1s after closing.

- Investigation History & Upstream Status
***Attempt 1 (Driver Delay):** Adding msleep() in the driver probe. (Rejected: 
delays belong in hardware description).
***Attempt 2 (Always On):** Keeping regulators ON and using Software Reset. 
(Works 100%, but prevents system-wide Deep Sleep/LPI).
***Attempt 3 (The Upstream Proposal):** Enforcing the regulator delay via DTS. 
(Withdrawn from upstream due to maintainer disagreement regarding the lack of 
direct register evidence, which is currently inaccessible due to hypervisor 
firewalls on this production device).

- Ideal Long-Term Fix
The hardware likely supports "Active Discharge" (draining the rail in <50ms). 
However, enabling this requires updates to the `qcom-rpmh-regulator` driver to 
send the correct voltage/mode resource commands, which is currently not 
implemented for this target. Until then, the `regulator-off-on-delay` is the 
only stable workaround.

I am maintaining these patches locally for now.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2138756

Title:
  [ov02c10] Camera unusable on Lenovo Yoga Slim 7x - system hangs, I2C
  timeouts, color artifacts

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2138756/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to