Hi Fabio, On Tue, Aug 20, 2024 at 09:50:04PM -0300, Fabio Estevam wrote: > On Tue, Aug 20, 2024 at 8:18 PM Fabio Estevam <festevam@xxxxxxxxx> wrote: > > > The pca953x driver tries to write to the i2c-2 bus before i2c-2 is registered. > > > > This is the point I don't understand: how can the pca953x driver get > > probed before its I2C bus parent? > > Disconsider what I wrote above. > > I'm trying to recover from the arbitration lost like this: > > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -491,6 +491,8 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct > *i2c_imx, int for_busy, bool a > /* check for arbitration lost */ > if (temp & I2SR_IAL) { > i2c_imx_clear_irq(i2c_imx, I2SR_IAL); > + pr_err("******* Arbitration lost\n"); > + i2c_recover_bus(&i2c_imx->adapter); > return -EAGAIN; > } > > @@ -1487,6 +1489,7 @@ static int i2c_imx_probe(struct platform_device *pdev) > i2c_imx->adapter.nr = pdev->id; > i2c_imx->adapter.dev.of_node = pdev->dev.of_node; > i2c_imx->base = base; > + i2c_imx->adapter.retries = 5; > ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev)); > > but still get pca953x probe failure: > > [ 1.756761] pca953x 2-0020: supply vcc not found, using dummy regulator > [ 1.766564] pca953x 2-0020: using no AI > [ 1.775333] ******* Arbitration lost > [ 1.783811] ******* Arbitration lost > [ 1.793701] ******* Arbitration lost > [ 1.797455] ******* Arbitration lost > [ 1.801209] ******* Arbitration lost > [ 1.804964] ******* Arbitration lost > [ 1.808562] pca953x 2-0020: failed writing register > [ 1.813602] pca953x: probe of 2-0020 failed with error -11 > [ 1.819222] i2c i2c-2: IMX I2C adapter registered Do you have a multi master i2c bus? If not, can you please test following patch: https://lore.kernel.org/all/20240715151824.90033-2-eichest@xxxxxxxxx/ Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |