diff options
author | Jae Hyun Yoo <jae.hyun.yoo@intel.com> | 2020-04-28 22:08:14 +0300 |
---|---|---|
committer | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2021-11-05 10:22:10 +0300 |
commit | afc473da0155c0ea21251de6fb2e379b5ccbe163 (patch) | |
tree | fef70b2f312af3b07220a33725b464c506429832 /drivers/i2c | |
parent | 53696233063899a68180725ad341096c10f42f66 (diff) | |
download | linux-afc473da0155c0ea21251de6fb2e379b5ccbe163.tar.xz |
i2c: aspeed: fix arbitration loss handling logic
When an arbitration loss happens in a multi-master bus, driver
drops the packet induce I2C subsystem to retry the transaction
by returning -EAGAIN. During this handling, tx_ack comes along
sometimes and it causes this this garbage printing
out:
aspeed-i2c-bus 1e78a400.i2c-bus: irq handled != irq. expected 0x00000009, but was 0x00000008
To fix this issue, this commit adds the tx_ack flag clearing into
the arbitration loss handling logic.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-aspeed.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index f4b82e457260..5c8ec9525c72 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -900,6 +900,9 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status) if (bus->master_state != ASPEED_I2C_MASTER_INACTIVE) { bus->cmd_err = ret; bus->master_state = ASPEED_I2C_MASTER_INACTIVE; + if (ret == -EAGAIN) + irq_handled |= (irq_status & + ASPEED_I2CD_INTR_TX_ACK); goto out_complete; } } |