Commit 445522f
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: 5ea5584 ("i2c: spacemit: add support for SpacemiT K1 SoC")
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>1 parent 41d6f90 commit 445522f
1 file changed
Lines changed: 7 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 270 | | |
284 | 271 | | |
285 | 272 | | |
| |||
412 | 399 | | |
413 | 400 | | |
414 | 401 | | |
415 | | - | |
416 | 402 | | |
417 | 403 | | |
418 | 404 | | |
| |||
429 | 415 | | |
430 | 416 | | |
431 | 417 | | |
| 418 | + | |
| 419 | + | |
432 | 420 | | |
433 | 421 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
439 | 426 | | |
| 427 | + | |
440 | 428 | | |
441 | 429 | | |
442 | 430 | | |
| |||
0 commit comments