i2c: rcar: clear NO_RXDMA flag after resetting
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 10 Jul 2024 11:03:00 +0000 (13:03 +0200)
committerAndi Shyti <andi.shyti@kernel.org>
Wed, 10 Jul 2024 20:52:30 +0000 (22:52 +0200)
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>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-rcar.c

index ec73463..f0724c8 100644 (file)
@@ -911,10 +911,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);