Re: [PATCH v1] i2c: imx: Retry transfer on transient failure

Uwe Kleine-König
2022-07-12T09:05:24Z

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

On Tue, Jul 12, 2022 at 10:24:15AM +0200, Francesco Dolcini wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@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@toradex.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@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/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]