Re: [PATCH v3 06/11] i3c: master: svc: use repeat start when IBI WIN happens
From: Miquel Raynal
Date: Fri Aug 23 2024 - 12:09:58 EST
Hi Frank,
Frank.Li@xxxxxxx wrote on Mon, 19 Aug 2024 12:02:00 -0400:
> There is a possibility of an IBI WIN occurring when addressing issues, even
> when sending CCC commands. Most of the time, returning -EAGAIN is
> acceptable, but the case below becomes highly complex.
>
> When a Hotjoin event occurs:
> - i3c_master_do_daa()
> - i3c_master_add_i3c_dev_locked()
> - A dynamic address (e.g., 0x9) is already set during DAA.
> - i3c_master_getpid_locked()
> - Another device issues HJ or IBI here. Returning -EAGAIN causes
> failure in adding the new device. However, the dynamic address(0x9)
> has already been assigned to this device. If another device issues
> HJ, it will get this address 0x9 again, causing two devices on the
> bus to use the same dynamic address 0x9.
> - Attempting to send RSTDAA when the first device fails at
> i3c_master_getpid_locked() could also fail when sending RSTDAA for
> the same reason.
>
> According to the I3C spec, address arbitration only happens at START, never
> at REPEAT start. Using repeat start when an IBI WIN occurs simplifies this
> case, as i3c_master_getpid_locked() will not return an error when another
> device tries to send HJ or IBI.
>
> Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
Feels sensible.
Acked-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Thanks,
Miquèl