[PATCH v1] i2c: imx: Retry transfer on transient failure
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Tue Jul 12 02:05:14 PDT 2022
On Tue, Jul 12, 2022 at 10:24:15AM +0200, Francesco Dolcini wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov at toradex.com>
>
> Set the i2c_adapter retries field to a sensible value. This allows
> the i2c core to retry master_xfer()/master_xfer_atomic() when it
> returns -EAGAIN. Currently the i2c-imx driver returns -EAGAIN only
> on Tx arbitration failure (I2SR_IAL).
>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov at toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini at toradex.com>
Additional to Marco's questions:
- I wouldn't have added a define for the constant as IMHO
i2c_imx->adapter.retries = 3;
is expressive enough. Thoughts?
- Is it right this is a driver specific setting? I would have expected
that this setting is in the realm of the i2c core. Grepping through
the drivers (git grep \\\<retries\\s\*= drivers/i2c/) shows a wide
variety between 0 and 5. (For some drivers you have do some deeper
checking than that grep because driver authors chose to use a define
for that; see above.)
- In which situations does this help? Please mention these in the
commit log.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220712/de5e20c7/attachment.sig>
More information about the linux-arm-kernel
mailing list