Re: [PATCH] media: atomisp: csi2-bridge: Don't cycle the PMC clock if its rate is correct

From: Andy Shevchenko

Date: Tue Nov 17 2026 - 05:02:52 EST


On Mon, Nov 16, 2026 at 05:33:06PM +0000, Volodymyr Chapman wrote:
> atomisp_csi2_set_pmc_clk_freq() enables and disables the sensor's PMC
> platform clock to be able to change its rate to 19.2 MHz. ACPI however
> also controls this clock, through the CLKx power resource in the sensor's
> _PR0, and caches the state of that power resource. When ACPI has already
> turned the clock on, the clk_disable_unprepare() turns it off underneath
> ACPI. ACPI keeps considering the clock to be on, so a following power-on
> of the sensor does not run the clock's _ON method and the sensor does
> not respond on I2C.
>
> On a Lenovo ThinkPad 10 (20C3) with an IMX175 rear sensor this makes the
> sensor's probe fail intermittently, depending on probe ordering:
>
> atomisp-isp2 0000:00:03.0: Found supported sensor INTCF1A:00
> imx175 i2c-INTCF1A:00: Error reading reg 0x0000: -121
> imx175 i2c-INTCF1A:00: probe with driver imx175 failed with error -121
>
> The effect of the clock cycle was also reproduced directly: with the
> sensor powered through ACPI, a single clk_prepare_enable() +
> clk_disable_unprepare() of pmc_plt_clk_0 makes it stop responding.
>
> Only cycle the clock to change its rate when it does not already run at
> 19.2 MHz. The DSDT's CLKx._ON methods on this machine already select the
> 19.2 MHz PLL.
>
> As a side effect, a clock which the firmware left enabled at 19.2 MHz is
> no longer turned off by atomisp_csi2_set_pmc_clk_freq(). It is turned off
> when ACPI powers down the sensor, e.g. when the sensor driver
> runtime-suspends it.

Besides below paragraphs (that I removed) needs to be in the comment block and
not in the commit message, please coordinate with other folk(s) who are doing
the same

https://lore.kernel.org/b4-sent/20261112-atomisp-pmc-clk-rate-v1-1-d6b3ef392ccf@xxxxxxxxx/

--
With Best Regards,
Andy Shevchenko