Re: [PATCH] media: atomisp: csi2-bridge: Only change the PMC clock rate when needed
From: Volodymyr Chapman
Date: Tue Nov 17 2026 - 12:48:35 EST
Hi Manuel,
On Thu, Nov 12, 2026 at 03:39:29PM +0000, Manuel Levi wrote:
> atomisp_csi2_set_pmc_clk_freq() enables and then disables the sensor's
> PMC platform clock before setting its rate to 19.2 MHz, which leaves the
> clock forced off in hardware.
[...]
> The enable/disable sequence is only needed to change the rate, which can
> default to 25 MHz on Bay Trail. On Cherry Trail the clocks already run at
> 19.2 MHz. Skip the sequence when the clock already has the right rate,
> so that the bridge leaves the clock state to ACPI.
[...]
> + if (clk_get_rate(clk) == PMC_CLK_RATE_19_2MHZ) {
> + clk_put(clk);
> + return 0;
> + }
I ran into the same problem independently on a Lenovo ThinkPad 10
(20C3, Bay Trail, Atom Z3795) with an IMX175 rear sensor (INTCF1A,
driver pending on linux-media) and an OV2722 front sensor, and sent the
same change, which I have now dropped in favour of yours.
I tested this patch as posted, with the atomisp driver built out of tree
against a 7.2.15 kernel, over 10 boots (7 reboots and 3 power-offs).
Both sensors were registered on every boot, with no chip ID read errors.
On this Bay Trail machine the clocks used by the sensors are already at
19.2 MHz after boot: the DSDT lists CLK0 in the IMX175's _PR0 and CLK1
in the OV2722's _PR0. pmc_plt_clk_0 and pmc_plt_clk_1 report 19.2
MHz, while the unused pmc_plt_clk_2, 4 and 5 report 25 MHz. I read these
after the bridge had run, so they don't show on their own that the
skip path was taken. Together with your clock trace results, it
looks consistent.
Tested-by: Volodymyr Chapman <volodymyrchapman@xxxxxxxxx> # Lenovo ThinkPad 10 (20C3)
Thanks,
Volodymyr