[PATCH] i2c: imx: fix clock and pinctrl state inconsistency in runtime PM
Andi Shyti
andi.shyti at kernel.org
Mon Jun 8 10:46:27 PDT 2026
Hi Carlos,
On Wed, May 20, 2026 at 06:49:39PM +0800, Carlos Song (OSS) wrote:
> From: Carlos Song <carlos.song at nxp.com>
>
> In i2c_imx_runtime_suspend(), the clock is disabled before switching
> the pinctrl state to sleep. If pinctrl_pm_select_sleep_state() fails,
> the runtime suspend is aborted but the clock remains disabled, causing
> a system crash when the hardware is subsequently accessed.
>
> Fix this by switching the pinctrl state before disabling the clock so
> that a pinctrl failure leaves the clock enabled and the hardware
> accessible.
>
> In i2c_imx_runtime_resume(), restore the pinctrl state back to sleep
> if clk_enable() fails to keep the two consistent.
>
> Fixes: 576eba03c994 ("i2c: imx: switch different pinctrl state in different system power status")
> Cc: stable at vger.kernel.org
> Signed-off-by: Carlos Song <carlos.song at nxp.com>
merged to i2c/i2c-host-fixes.
Thanks,
Andi
More information about the linux-arm-kernel
mailing list