Re: [PATCH v2] i2c: omap: Fix standard mode false ACK readings

Andreas Kemnade
2024-11-06T09:23:55Z

Am Wed, 11 Sep 2024 11:40:04 +0200
schrieb "H. Nikolaus Schaller" <hns@goldelico.com>:

> Hi,
>
> > Am 28.04.2023 um 20:30 schrieb Reid Tonking <reidt@ti.com>:
> >
> > On 10:43-20230428, Tony Lindgren wrote:
> >> * Raghavendra, Vignesh <vigneshr@ti.com> [230427 13:18]:
> >>> On 4/27/2023 1:19 AM, Reid Tonking wrote:
> >>>> Using standard mode, rare false ACK responses were appearing with
> >>>> i2cdetect tool. This was happening due to NACK interrupt
> >>>> triggering ISR thread before register access interrupt was
> >>>> ready. Removing the NACK interrupt's ability to trigger ISR
> >>>> thread lets register access ready interrupt do this instead.
> >>
> >> So is it safe to leave NACK interrupt unhandled until we get the
> >> next interrupt, does the ARDY always trigger after hitting this?
> >>
> >> Regards,
> >>
> >> Tony
> >
> > Yep, the ARDY always gets set after a new command when register
> > access is ready so there's no need for NACK interrupt to control
> > this.
>
> I have tested one GTA04A5 board where this patch breaks boot on
> v4.19.283 or v6.11-rc7 (where it was inherited from some earlier -rc
> series).
>
> The device is either stuck with no signs of activity or reports RCU
> stalls after a 20 second pause.
>
Reproduced some problem here:
i2cset 1 0x69 0x14 0xb6 (reset command for gyro BMG160)
[ 736.136108] omap_i2c 48072000.i2c: addr: 0x0069, len: 2, flags: 0x0,
stop: 1
[ 736.136322] omap_i2c 48072000.i2c: IRQ (ISR = 0x0010)
either with this patch applied:
... system mostly hangs, i2cset does not return.
with it reverted:
... most times I see after this:
[ 736.136505] omap_i2c 48072000.i2c: IRQ (ISR = 0x0002)
and i2cset says:
i2cset: write failed: Remote I/O error

... sometimes:
omap_i2c 48072000.i2c: IRQ (ISR = 0x0004)
and i2cset is successful.

Other register writes seem to work reliably, just the reset command.
I had tested with bmg driver disabled earlier,
so it did not come to light.

Regards,
Andreas