From: Saikiran <bjsaikiran@gmail.com>
To: linux-media@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org, rfoss@kernel.org,
todor.too@gmail.com, bryan.odonoghue@linaro.org, bod@kernel.org,
vladimir.zapolskiy@linaro.org, hansg@kernel.org,
sakari.ailus@linux.intel.com, mchehab@kernel.org,
stable@vger.kernel.org
Subject: [PATCH v3 0/3] media: i2c: ov02c10: Fix brownouts and power sequence
Date: Mon, 26 Jan 2026 23:04:41 +0530 [thread overview]
Message-ID: <20260126173444.10228-1-bjsaikiran@gmail.com> (raw)
This series addresses stability issues with the OV02C10 sensor on Qualcomm
Snapdragon X Elite (X1E80100) platforms, specifically the Lenovo Yoga Slim 7x.
Note: This series supersedes all previous patch sets submitted by me regarding
OV02C10 / media stability and cleanup on X1E80100 (including the 'pipeline
lock' and 'brownout' series). Please disregard prior versions.
Problem 1: Brownouts during rapid cycling
On this platform, the RPMh-controlled regulators lack active discharge, taking
~2.3s to passively discharge. Rapid close/open cycles (e.g., WebRTC checks)
re-enable regulators while the rails are floating, causing the sensor to hang.
Previous attempts to manage this via open-loop delays in power_on were deemed
incorrect.
Problem 2: Incorrect Power Sequence
The driver was not strictly following the datasheet power-up timing (T1/T2),
potentially leading to race conditions between the reset pin and power rails.
Problem 3: Race condition on removal
The remove() function freed resources before powering off the device, causing
use-after-free errors if userspace (PipeWire) accessed controls during removal.
Solution in v3:
1. Implement Runtime PM Autosuspend (1000ms). This prevents the driver from
cutting power during rapid user interactions, sidestepping the slow
regulator discharge window entirely. (Patch 3)
2. Enforce strict datasheet power-on sequencing with ample delays to satisfy
maintainer requirements for clean boot. (Patch 2)
3. Fix the remove() race condition by reordering cleanup. (Patch 1)
Changes in v3:
- Dropped the "always-on" regulator patch from v2.
- Added Runtime PM Autosuspend support (Patch 3).
- Added strict power-on sequencing with 10ms/20ms delays (Patch 2).
- Added fix for use-after-free in remove() (Patch 1).
Link: https://lore.kernel.org/linux-media/20260125171745.484806-1-bjsaikiran@gmail.com/T/#t [1]
Saikiran (3):
media: i2c: ov02c10: Fix use-after-free in remove function
media: i2c: ov02c10: Correct power-on sequence and timing
media: i2c: ov02c10: Use runtime PM autosuspend to avoid brownouts
drivers/media/i2c/ov02c10.c | 70 ++++++++++++++++++++++++++++++-------
1 file changed, 58 insertions(+), 12 deletions(-)
next reply other threads:[~2026-01-26 17:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 17:34 Saikiran [this message]
2026-01-26 17:34 ` [PATCH v3 1/3] media: i2c: ov02c10: Fix use-after-free in remove function Saikiran
2026-01-27 10:30 ` Hans de Goede
2026-01-26 17:34 ` [PATCH v3 2/3] media: i2c: ov02c10: Correct power-on sequence and timing Saikiran
2026-01-27 10:40 ` Hans de Goede
2026-01-27 10:47 ` Bryan O'Donoghue
2026-01-27 10:50 ` Hans de Goede
2026-01-26 17:34 ` [PATCH v3 3/3] media: i2c: ov02c10: Use runtime PM autosuspend to avoid brownouts Saikiran
2026-01-27 9:46 ` Bryan O'Donoghue
2026-01-27 10:43 ` Hans de Goede
2026-01-27 10:44 ` Hans de Goede
[not found] ` <CAAFDt1tsyvtAa84bFK2Hq5yG_F15SUUseBd5Xi-DB8GnUj7+7A@mail.gmail.com>
2026-01-27 10:50 ` Bryan O'Donoghue
[not found] ` <CAAFDt1vKn5ssoTQZduGKb5eOeN74P=FVk9f01go1d-JS71Zt0A@mail.gmail.com>
2026-01-27 11:06 ` Bryan O'Donoghue
2026-01-27 11:11 ` Bryan O'Donoghue
2026-01-27 16:20 ` Saikiran B
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=20260126173444.10228-1-bjsaikiran@gmail.com \
--to=bjsaikiran@gmail.com \
--cc=bod@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=hansg@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rfoss@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=todor.too@gmail.com \
--cc=vladimir.zapolskiy@linaro.org \
/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