[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97091c58-b893-46cd-aae9-18b04bd2ae58@linux.intel.com>
Date: Wed, 30 Jul 2025 16:31:39 +0300
From: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Jan Dabros <jsd@...ihalf.com>, Andi Shyti <andi.shyti@...nel.org>
Cc: Kohei Ito <ito.kohei@...ionext.com>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] i2c: designware: Fix clock issue when PM is
disabled
Hi
On 7/24/25 7:22 AM, Kunihiko Hayashi wrote:
> When removing the driver, enable the clocks once by calling
> pm_runtime_get_sync(), and call pm_runtime_put_sync() to disable
> the clocks.
>
> If CONFIG_PM=y, clocks for this controller are disabled when it's in
> the idle state. So the clocks are properly disabled when the driver
> exits.
>
> Othewise, the clocks are always enabled and the PM functions have
> no effect. Therefore, the driver exits without disabling the clocks.
>
> # cat /sys/kernel/debug/clk/clk-pclk/clk_enable_count
> 18
> # echo 1214a000.i2c > /sys/bus/platform/drivers/i2c_designware/bind
> # cat /sys/kernel/debug/clk/clk-pclk/clk_enable_count
> 20
> # echo 1214a000.i2c > /sys/bus/platform/drivers/i2c_designware/unbind
> # cat /sys/kernel/debug/clk/clk-pclk/clk_enable_count
> 20
>
> To ensure that the clocks can be disabled correctly even without
> CONFIG_PM=y, should add the following fixes:
>
> - Replace with pm_runtime_put_noidle(), which only decrements the runtime
> PM usage count.
> - Call i2c_dw_prepare_clk(false) to explicitly disable the clocks.
>
> Fixes: 7272194ed391f ("i2c-designware: add minimal support for runtime PM")
> Co-developed-by: Kohei Ito <ito.kohei@...ionext.com>
> Signed-off-by: Kohei Ito <ito.kohei@...ionext.com>
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Good catch!
Tested-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Acked-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Powered by blists - more mailing lists