RE: [PATCH v3] i2c: imx: mark I2C adapter when hardware is powered down
From: Carlos Song (OSS)
Date: Thu May 21 2026 - 04:33:10 EST
> -----Original Message-----
> From: Mukesh Savaliya <mukesh.savaliya@xxxxxxxxxxxxxxxx>
> Sent: Thursday, May 21, 2026 3:40 PM
> To: Carlos Song (OSS) <carlos.song@xxxxxxxxxxx>; o.rempel@xxxxxxxxxxxxxx;
> kernel@xxxxxxxxxxxxxx; andi.shyti@xxxxxxxxxx; Frank Li <frank.li@xxxxxxx>;
> s.hauer@xxxxxxxxxxxxxx; festevam@xxxxxxxxx; Carlos Song
> <carlos.song@xxxxxxx>; Bough Chen <haibo.chen@xxxxxxx>
> Cc: linux-i2c@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx;
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> stable@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v3] i2c: imx: mark I2C adapter when hardware is powered
> down
>
> [You don't often get email from mukesh.savaliya@xxxxxxxxxxxxxxxx. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi Carlos,
>
> On 5/20/2026 3:45 PM, Carlos Song (OSS) wrote:
> > From: Carlos Song <carlos.song@xxxxxxx>
> >
> > Mark the I2C adapter as suspended during system suspend to block
> > further transfers, and resume it on system resume. This prevents
> > potential hangs when the hardware is powered down but clients still attempt
> I2C transfers.
> >
> Code changes looks fine to me but have comment on commit log.
>
> It seems, you are adding support of _noirq() callbacks to allow transfers during
> suspend/resume noirq phase of PM.
>
> Would it make sense if you can write "Replace system PM callbacks with noirq
> PM callbacks" OR "Allow transfers during _noirq phase of the PM ops" instead of
> "mark I2C adapter when hardware is powered down" ?
>
Hi,
Thank you for your comments!
But this patch is added is not for support noirq PM callback or transfer in noirq phase.
In fact, this fix is to mark the I2C adapter as suspended during system noirq suspend to block further
transfers, and resume it on system noirq resume. This is to prohibit I2C device calling the I2C controller
after the system noirq suspend and before noirq resume, because at this time the I2C instance is powered
off or the clock is disabled ... So I want to keep current commit. How do you think?
Carlos Song
> > Fixes: 358025ac091e ("i2c: imx: make controller available until system
> > suspend_noirq() and from resume_noirq()")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Carlos Song <carlos.song@xxxxxxx>
> > ---
> > Change for v3:
> > - Add hrtimer_cancel in i2c_imx_suspend_noirq to cancel slave_timer for
> > safe suspend in i2c slave mode.
> > Change for v2:
> > - Call i2c_mark_adapter_suspended() before
> pm_runtime_force_suspend()
> > to prevent potential deadlock if a transfer is active during suspend.
> > - Roll back with i2c_mark_adapter_resumed() if
> pm_runtime_force_suspend()
> > fails.
> > ---
>
> [...]