1 From f14a14edf12354103e28e8b0336614385766b30a Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 23 May 2023 14:14:05 +0100
4 Subject: [PATCH] i2c-bcm2835: Do not abort transfers on ERR if still
7 If a transaction is aborted immediately on ERR being reported,
8 then the bus is not returned to the STOP condition, and devices
9 generally get very upset.
11 Handle the ERR and CLKT conditions only when TA is not set.
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 drivers/i2c/busses/i2c-bcm2835.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
18 --- a/drivers/i2c/busses/i2c-bcm2835.c
19 +++ b/drivers/i2c/busses/i2c-bcm2835.c
20 @@ -385,7 +385,7 @@ static irqreturn_t bcm2835_i2c_isr(int t
21 bcm2835_debug_add(i2c_dev, val);
23 err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR);
25 + if (err && !(val & BCM2835_I2C_S_TA))
26 i2c_dev->msg_err = err;
28 if (val & BCM2835_I2C_S_DONE) {