hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/busses/i2c-aspeed.c
....@@ -693,13 +693,16 @@
693693
694694 if (time_left == 0) {
695695 /*
696
- * If timed out and bus is still busy in a multi master
697
- * environment, attempt recovery at here.
696
+ * In a multi-master setup, if a timeout occurs, attempt
697
+ * recovery. But if the bus is idle, we still need to reset the
698
+ * i2c controller to clear the remaining interrupts.
698699 */
699700 if (bus->multi_master &&
700701 (readl(bus->base + ASPEED_I2C_CMD_REG) &
701702 ASPEED_I2CD_BUS_BUSY_STS))
702703 aspeed_i2c_recover_bus(bus);
704
+ else
705
+ aspeed_i2c_reset(bus);
703706
704707 /*
705708 * If timed out and the state is still pending, drop the pending