[PATCH] I2C: cdns: Fix broken retry mechanism on arbitration lost.

Heiko Schocher hs at denx.de
Mon Jun 5 09:36:36 CEST 2023


Hello Andrea,

On 26.05.23 16:56, Andrea Merello wrote:
> In the current implementation, in case of I2C arbitration lost, a retry is
> attempted; the message counter and pointer are reset to the original values
> and the I2C xfer process is restart from the beginning.
> 
> However the message counter and message pointer are respectively
> decremented and incremented by one before attempting any transfer, causing
> the 1st transfer not to be actually retried (in case of a single transfer,
> nothing is actually retried at all).
> 
> This patch fixes this: in case of retry, the 1st transfer is also retried.
> 
> Tested on a ZynqMP Kria board, with upstream older u-boot, but the involved
> file and underlying logic seem basically the same.
> 
> Signed-off-by: Andrea Merello <andrea.merello at iit.it>
> ---
>  drivers/i2c/i2c-cdns.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Applied to u-boot-i2c.git master

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list