mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Volodymyr Chapman <volodymyrchapman@gmail.com>
Cc: Hans de Goede <hansg@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Andy Shevchenko <andy@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: atomisp: csi2-bridge: Don't cycle the PMC clock if its rate is correct
Date: Tue, 17 Nov 2026 12:02:38 +0200	[thread overview]
Message-ID: <avwmPmzohY3BCwrI@ashevche-desk.local> (raw)
In-Reply-To: <20261116173307.14169-1-volodymyrchapman@gmail.com>

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@gmail.com/

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-11-17 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 17:33 Volodymyr Chapman
2026-11-17 10:02 ` Andy Shevchenko [this message]

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=avwmPmzohY3BCwrI@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=volodymyrchapman@gmail.com \
    /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

all inboxes | Powered by JetHome®