Re: [PATCH] media: i2c: dw9719: power down on detection errors
From: Chris Simpson
Date: Sat Oct 17 2026 - 17:41:15 EST
On Sun, 13 Sep 2026 00:18:28 -0400, Myeonghun Pak wrote:
> Moving chip detection into dw9719_power_up() introduced direct returns
> after the regulator has been enabled. An INFO register read failure or
> an unrecognized ID bypasses the power-down path, while probe only
> cleans up the media entity and controls after a power-up error.
I found the same leak independently while adding DW9800W support for
the Surface Pro 9, and wrote the same change.
I tested both error paths on a Surface Pro 9 (DW9800W, ACPI, a 7.2.11
distro kernel with the linux-surface patches), forcing them with a
test-only hook: an unknown INFO id, and a failed INFO read. Without your
patch, each failed probe hit the WARN_ON(regulator->enable_count) in
_regulator_put(), reported as regulator_put() because it is inlined
there, and the (dummy) supply's num_users stayed one higher. With your
patch, neither happened. An equivalent change in my tree also runs fine
through the normal path, including runtime and system suspend.
Reviewed-by: Chris Simpson <chris@xxxxxxxx>
Tested-by: Chris Simpson <chris@xxxxxxxx>
The patch still applies cleanly to the media-committers next branch.
Thanks,
Chris
Made with AI assistance. Written by Claude Opus 5.5 (drafting), with
review by Claude Fable 5.1 and testing by Claude Opus 5.5, under the
direction of Chris Simpson <chris@xxxxxxxx>, who reviewed and approved
it.