[PATCH v2] i2c: spacemit: fix detect issue
Andi Shyti
andi.shyti at kernel.org
Wed Dec 3 12:46:02 PST 2025
Hi Troy,
On Thu, Nov 13, 2025 at 09:21:50PM +0800, Troy Mitchell wrote:
> This commit addresses two issues causing i2c detect to fail.
>
> The identified issues are:
>
> 1. Incorrect error handling for BED (Bus Error No ACK/NAK):
> Before this commit, Both ALD (Arbitration Loss Detected) and
> BED returned -EAGAIN.
> 2. Missing interrupt status clear after initialization in xfer():
> On the K1 SoC, simply fixing the first issue changed the error
> from -EAGAIN to -ETIMEOUT. Through tracing, it was determined that
> this is likely due to MSD (Master Stop Detected) latency issues.
>
> That means the MSD bit in the ISR may still be set on the next transfer.
> As a result, the controller won't work — we can see from the scope that
> it doesn't issue any signal.
> (This only occurs during rapid consecutive I2C transfers.
> That explains why the issue only shows up with i2cdetect.)
>
> With these two fixes, i2c device detection now functions correctly on the K1 SoC.
>
> Fixes: 5ea558473fa31 ("i2c: spacemit: add support for SpacemiT K1 SoC")
> Tested-by: Aurelien Jarno <aurelien at aurel32.net>
> Signed-off-by: Troy Mitchell <troy.mitchell at linux.spacemit.com>
merged to i2c/i2c-host.
Thanks,
Andi
More information about the linux-riscv
mailing list