[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E0A67745AA4B2621+aNHuBTk9aK3AnZjR@LT-Guozexi>
Date: Tue, 23 Sep 2025 08:47:01 +0800
From: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
To: Troy Mitchell <troy.mitchell@...ux.spacemit.com>,
Andi Shyti <andi.shyti@...nel.org>, Yixun Lan <dlan@...too.org>,
Alex Elder <elder@...cstar.com>,
Troy Mitchell <troymitchell988@...il.com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev
Subject: Re: [PATCH 4/6] i2c: spacemit: check SDA instead of SCL after bus
reset
On Mon, Sep 22, 2025 at 10:56:04PM +0200, Aurelien Jarno wrote:
> On 2025-08-27 15:39, Troy Mitchell wrote:
> > After calling spacemit_i2c_conditionally_reset_bus(),
> > the controller should ensure that the SDA line is release
> > before proceeding.
> >
> > Previously, the driver checked the SCL line instead,
> > which does not guarantee that the bus is truly idle.
> >
> > This patch changes the check to verify SDA. This ensures
> > proper bus recovery and avoids potential communication errors
> > after a conditional reset.
> >
> > Fixes: 5ea558473fa31 ("i2c: spacemit: add support for SpacemiT K1 SoC")
> > Signed-off-by: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
> > ---
> > drivers/i2c/busses/i2c-k1.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-k1.c b/drivers/i2c/busses/i2c-k1.c
> > index c1656b78f1681729ccc2ebca6e290259d14889d9..4d78ee7b6929ee43771e500d4f85d9e55e68b221 100644
> > --- a/drivers/i2c/busses/i2c-k1.c
> > +++ b/drivers/i2c/busses/i2c-k1.c
> > @@ -172,9 +172,9 @@ static void spacemit_i2c_conditionally_reset_bus(struct spacemit_i2c_dev *i2c)
> > spacemit_i2c_reset(i2c);
> > usleep_range(10, 20);
> >
> > - /* check scl status again */
> > + /* check sda again here */
> > status = readl(i2c->base + SPACEMIT_IBMR);
> > - if (!(status & SPACEMIT_BMR_SCL))
> > + if (!(status & SPACEMIT_BMR_SDA))
> > dev_warn_ratelimited(i2c->dev, "unit reset failed\n");
> > }
>
> Reviewed-by: Aurelien Jarno <aurelien@...el32.net>
Thanks for the RB!
- Troy
>
> --
> Aurelien Jarno GPG: 4096R/1DDD8C9B
> aurelien@...el32.net http://aurel32.net
>
Powered by blists - more mailing lists