bcm27xx: 6.1: add kernel patches
[openwrt/staging/stintel.git] / target / linux / bcm27xx / patches-6.1 / 950-0736-i2c-bcm2835-Do-not-abort-transfers-on-ERR-if-still-a.patch
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
5 active
6
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.
10
11 Handle the ERR and CLKT conditions only when TA is not set.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 ---
15 drivers/i2c/busses/i2c-bcm2835.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
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);
22
23 err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR);
24 - if (err)
25 + if (err && !(val & BCM2835_I2C_S_TA))
26 i2c_dev->msg_err = err;
27
28 if (val & BCM2835_I2C_S_DONE) {