-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2c: designware: Add support for bus clear feature #6071
Conversation
I can provoke the lockup using a VEML7700 by running:
Reading pairs of bytes, as expected by the device, does not exhibit the problem:
|
Newer versions of the DesignWare I2C block support the detection of stuck signals, and a mechanism to recover from them. Add the required software support to the driver. This change was prompted by the observation that reading a single byte from register 0 of a VEML7700 seems to cause it to issue an ACK too early, and the controller to complain about losing arbitration. There is a suspicion that this may be a more widespread problem, but at least this patch prevents the bus from locking up. See: raspberrypi#6057 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
It's also worth noting that the same sequence also causes an error on Pi 4 (and presumably the other members of the BCM2835 family). For anyone interested, the early ACK makes the read portion of the second access appear as another write, i.e:
|
The autobuilds have completed - running |
I tested this on a number of different slave devices and did not observe any regressions. |
Thanks - that's good to hear. |
See: raspberrypi/linux#6076 kernel: i2c: designware: Add support for bus clear feature See: raspberrypi/linux#6071 kernel: RTC PCF2131 support See: raspberrypi/linux#6070 kernel: allo-boss-dac mute output when changing parameters See: raspberrypi/linux#6074 kernel: dts: bcm2712: Add blpubkey nvram node See: raspberrypi/linux#6073 kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling See: raspberrypi/linux#6060 kernel: drm/vc4: Enable bg_fill if there are no planes enabled See: raspberrypi/linux#6066 kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information See: raspberrypi/linux#6061
See: raspberrypi/linux#6076 kernel: i2c: designware: Add support for bus clear feature See: raspberrypi/linux#6071 kernel: RTC PCF2131 support See: raspberrypi/linux#6070 kernel: allo-boss-dac mute output when changing parameters See: raspberrypi/linux#6074 kernel: dts: bcm2712: Add blpubkey nvram node See: raspberrypi/linux#6073 kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling See: raspberrypi/linux#6060 kernel: drm/vc4: Enable bg_fill if there are no planes enabled See: raspberrypi/linux#6066 kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information See: raspberrypi/linux#6061
Newer versions of the DesignWare I2C block support the detection of stuck signals, and a mechanism to recover from them. Add the required software support to the driver.
This change was prompted by the observation that reading a single byte from register 0 of a VEML7700 seems to cause it to issue an ACK too early, and the controller to complain about losing arbitration. There is a suspicion that this may be a more widespread problem, but at least this patch prevents the bus from locking up.
See: #6057