diff mbox series

i2c: rcar: clear NO_RXDMA flag after resetting

Message ID 20240710110259.49181-2-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series i2c: rcar: clear NO_RXDMA flag after resetting | expand

Commit Message

Wolfram Sang July 10, 2024, 11:03 a.m. UTC
We should allow RXDMA only if the reset was really successful, so clear
the flag after the reset call.

Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-rcar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andi Shyti July 11, 2024, 2:30 p.m. UTC | #1
Hi Wolfram,

On Wed, Jul 10, 2024 at 01:03:00PM GMT, Wolfram Sang wrote:
> We should allow RXDMA only if the reset was really successful, so clear
> the flag after the reset call.
> 
> Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

pushed to i2c/i2c-host-fixes.

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 29c7fafeb8a9..8f2ede534f30 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -912,10 +912,10 @@  static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
 
 	/* Gen3+ needs a reset. That also allows RXDMA once */
 	if (priv->devtype >= I2C_RCAR_GEN3) {
-		priv->flags &= ~ID_P_NO_RXDMA;
 		ret = rcar_i2c_do_reset(priv);
 		if (ret)
 			goto out;
+		priv->flags &= ~ID_P_NO_RXDMA;
 	}
 
 	rcar_i2c_init(priv);