RE: [PATCH v1 2/2] i2c: imx: ensure no clock is generated after last read
From: Carlos Song
Date: Tue Mar 03 2026 - 22:01:58 EST
> -----Original Message-----
> From: Frank Li <frank.li@xxxxxxx>
> Sent: Tuesday, March 3, 2026 11:54 PM
> To: Stefan Eichenberger <eichest@xxxxxxxxx>; Carlos Song
> <carlos.song@xxxxxxx>
> Cc: o.rempel@xxxxxxxxxxxxxx; kernel@xxxxxxxxxxxxxx; andi.shyti@xxxxxxxxxx;
> s.hauer@xxxxxxxxxxxxxx; festevam@xxxxxxxxx;
> stefan.eichenberger@xxxxxxxxxxx; Francesco Dolcini
> <francesco.dolcini@xxxxxxxxxxx>; linux-i2c@xxxxxxxxxxxxxxx;
> imx@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; stable@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1 2/2] i2c: imx: ensure no clock is generated after last
> read
>
> On Tue, Mar 03, 2026 at 10:14:08AM +0100, Stefan Eichenberger wrote:
> > Hi Frank,
> >
> > On Wed, Feb 18, 2026 at 05:37:54PM +0100, Stefan Eichenberger wrote:
> > > Hi Frank,
> > >
> > > On Wed, Feb 18, 2026 at 11:26:52AM -0500, Frank Li wrote:
> > > > On Wed, Feb 18, 2026 at 04:08:50PM +0100, Stefan Eichenberger wrote:
> > > > > From: Stefan Eichenberger <stefan.eichenberger@xxxxxxxxxxx>
> > > > >
> > > > > When reading from the I2DR register, right after releasing the
> > > > > bus by clearing MSTA and MTX, the I2C controller might still
> > > > > generate an additional clock cycle which can cause devices to
> > > > > misbehave. Ensure to
> > > >
> > > > Do you means SCL have additional toggle? You capture waveform?
> > > >
> > >
> > > Yes exactly. We were able to capture the waveform when the issue
> > > happens. It doesn't always happen though, it depends on how much
> > > time passes between clearing MSTA and MTX and reading from I2DR.
> > >
> > > If you want to see the waveform, I uploaded it to our server:
> > > https://share.toradex.com/dwnhcrl6b9toib6
> > > You can see the additional clock at the right end, after "0x17 + NAK".
> >
> > Have you had a chance to look at the waveform? Do you have any
> > concerns about the proposed solution?
>
> I am fine. Add carlos, who did many work about I2C.
>
> Frank
Hi,
Just review this series, looks this series patch make this fix for the limitation[1] safer:
"It must generate STOP before read I2DR to prevent controller from generating another clock cycle".
Previous patch[2] has done this to avoid the limitation. However according to the waveform, I2C controller still generated an additional clock cycle sometime.
The key of patch is ensure to read the last bytes after the bus is not busy anymore to avoid this another clock cycle.So these patches are fine to me also.
[1] 054b62d9f25c ("i2c: imx: fix the i2c bus hang issue when do repeat restart")
[2] 5f5c2d4579ca ("i2c: imx: prevent rescheduling in non dma mode")
> >
> > Best regards,
> > Stefan