| .. | .. |
|---|
| 693 | 693 | |
|---|
| 694 | 694 | if (time_left == 0) { |
|---|
| 695 | 695 | /* |
|---|
| 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. |
|---|
| 698 | 699 | */ |
|---|
| 699 | 700 | if (bus->multi_master && |
|---|
| 700 | 701 | (readl(bus->base + ASPEED_I2C_CMD_REG) & |
|---|
| 701 | 702 | ASPEED_I2CD_BUS_BUSY_STS)) |
|---|
| 702 | 703 | aspeed_i2c_recover_bus(bus); |
|---|
| 704 | + else |
|---|
| 705 | + aspeed_i2c_reset(bus); |
|---|
| 703 | 706 | |
|---|
| 704 | 707 | /* |
|---|
| 705 | 708 | * If timed out and the state is still pending, drop the pending |
|---|