Re: [PATCH v2] i2c: iproc: reset bus after timeout if START_BUSY is stuck

Ray Jui <[email protected]> Tue, 28 Jul 2026 09:34:55 -0700
Newsgroups org.kernel.vger.linux-i2c,org.kernel.vger.linux-kernel
Message-ID <CAJ8Y1dQgWzg+updo+QB1c3MdMzje2PKDFhaL4F3LqWadR8x0zQ@mail.gmail.com>
Hi Andi / Jonas,

On Tue, Jul 28, 2026 at 8:04 AM Andi Shyti <[email protected]> wrote:

> Hi Jonas,
>
> ...
>
> > diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c
> b/drivers/i2c/busses/i2c-bcm-iproc.c
> > index b5629cffe99b..86ca4c2221c4 100644
> > --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> > +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> > @@ -803,6 +803,17 @@ static int bcm_iproc_i2c_xfer_wait(struct
> bcm_iproc_i2c_dev *iproc_i2c,
> >       }
> >
> >       if (!time_left && !iproc_i2c->xfer_is_done) {
> > +             /*
> > +              * The controller may fail to clear START_BUSY after a
> timeout,
> > +              * reset the controller to recover in that case.
> > +              */
> > +             if (!!(iproc_i2c_rd_reg(iproc_i2c, M_CMD_OFFSET) &
> > +                    BIT(M_CMD_START_BUSY_SHIFT))) {
> > +                     bcm_iproc_i2c_enable_disable(iproc_i2c, false);
> > +                     bcm_iproc_i2c_init(iproc_i2c);
> > +                     bcm_iproc_i2c_enable_disable(iproc_i2c, true);
> > +             }
> > +
> >               /* flush both TX/RX FIFOs */
> >               val = BIT(M_FIFO_RX_FLUSH_SHIFT) |
> BIT(M_FIFO_TX_FLUSH_SHIFT);
> >               iproc_i2c_wr_reg(iproc_i2c, M_FIFO_CTRL_OFFSET, val);
>
> the patch makes sense to me, but can I have an ack from the
> Broadcom folks? Ray? Scott?
>

Sorry for the late reply. But yea, this reset after timeout when start busy
is still set looks good to me. Thanks.

Acked-by: Ray Jui <[email protected]>


>
> Thanks,
> Andi
>
smime.p7s (application/pkcs7-signature, 5.3 KB) - not displayed