Skip to content

Commit

Permalink
i2c: designware: must wait for enable
Browse files Browse the repository at this point in the history
One I2C bus on my Atom E3845 board has been broken since 4.9.
It has two devices, both declared by ACPI and with built-in drivers.

There are two back-to-back transactions originating from the kernel, one
targeting each device. The first transaction works, the second one locks
up the I2C controller. The controller never recovers.

These kernel logs show up whenever an I2C transaction is attempted after
this failure.
i2c-designware-pci 0000:00:18.3: timeout in disabling adapter
i2c-designware-pci 0000:00:18.3: timeout waiting for bus ready

Waiting for the I2C controller status to indicate that it is enabled
before programming it fixes the issue.

I have tested this patch on 4.14 and 4.15.

Fixes: commit 2702ea7 ("i2c: designware: wait for disable/enable only if necessary")
Cc: linux-stable <[email protected]> #4.13+
Signed-off-by: Ben Gardner <[email protected]>
Acked-by: Jarkko Nikula <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
bengardner authored and Wolfram Sang committed Feb 21, 2018
1 parent 91ab883 commit fba4adb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-designware-master.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
i2c_dw_disable_int(dev);

/* Enable the adapter */
__i2c_dw_enable(dev, true);
__i2c_dw_enable_and_wait(dev, true);

/* Clear and enable interrupts */
dw_readl(dev, DW_IC_CLR_INTR);
Expand Down

0 comments on commit fba4adb

Please sign in to comment.