lede/target/linux/bcm27xx/patches-6.12/950-0327-i2c-bcm2835-Flush-FIFOs-cleanly-on-error.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= d81c03f05e bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-06-20 17:01:06 +08:00

46 lines
1.3 KiB
Diff

From 70453609680a9cc8eedd8225d91140c7df842ed8 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Tue, 23 May 2023 14:11:52 +0100
Subject: [PATCH] i2c-bcm2835: Flush FIFOs cleanly on error
On error condition, note the error return code, but still
handle the FIFOs in the normal way rather than relying on
C_CLEAR flushing everything cleanly.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/i2c/busses/i2c-bcm2835.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -385,10 +385,8 @@ static irqreturn_t bcm2835_i2c_isr(int t
bcm2835_debug_add(i2c_dev, val);
err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR);
- if (err) {
+ if (err)
i2c_dev->msg_err = err;
- goto complete;
- }
if (val & BCM2835_I2C_S_DONE) {
if (!i2c_dev->curr_msg) {
@@ -400,8 +398,6 @@ static irqreturn_t bcm2835_i2c_isr(int t
if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining)
i2c_dev->msg_err = BCM2835_I2C_S_LEN;
- else
- i2c_dev->msg_err = 0;
goto complete;
}
@@ -465,6 +461,7 @@ static int bcm2835_i2c_xfer(struct i2c_a
i2c_dev->curr_msg = msgs;
i2c_dev->num_msgs = num;
+ i2c_dev->msg_err = 0;
reinit_completion(&i2c_dev->completion);
bcm2835_i2c_start_transfer(i2c_dev);