Commit 445522fe authored by Troy Mitchell's avatar Troy Mitchell Committed by Wolfram Sang
Browse files

i2c: spacemit: remove stop function to avoid bus error



Previously, STOP handling was split into two separate steps:
  1) clear TB/STOP/START/ACK bits
  2) issue STOP by calling spacemit_i2c_stop()

This left a small window where the control register was updated
twice, which can confuse the controller. While this race has not
been observed with interrupt-driven transfers, it reliably causes
bus errors in PIO mode.

Inline the STOP sequence into the IRQ handler and ensure that
control register bits are updated atomically in a single writel().

Fixes: 5ea55847 ("i2c: spacemit: add support for SpacemiT K1 SoC")
Signed-off-by: default avatarTroy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: default avatarAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent 41d6f90e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment