Re: [PATCH V2 4/7] i3c: mipi-i3c-hci: Tolerate i3c_master_add_i3c_dev_locked() failures in DAA
From: Frank Li
Date: Mon Jun 08 2026 - 13:49:14 EST
On Mon, Jun 08, 2026 at 10:57:57AM +0300, Adrian Hunter wrote:
> i3c_master_add_i3c_dev_locked() no longer leaves the address marked as
> free on failure, so aborting the DAA sequence on its error is unnecessary.
>
> Failure to register a discovered device does not invalidate the entire
> Dynamic Address Assignment (DAA) procedure. Align with the behavior of
> other I3C master drivers by ignoring errors from
> i3c_master_add_i3c_dev_locked() and continuing enumeration.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
>
>
> Changes in V2:
>
> None
>
>
> drivers/i3c/master/mipi-i3c-hci/cmd_v1.c | 4 +---
> drivers/i3c/master/mipi-i3c-hci/cmd_v2.c | 4 +---
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c b/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c
> index 75d452d7f6af..3b9345718d27 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/cmd_v1.c
> @@ -358,9 +358,7 @@ static int hci_cmd_v1_daa(struct i3c_hci *hci)
> * TODO: Extend the subsystem layer to allow for registering
> * new device and provide BCR/DCR/PID at the same time.
> */
> - ret = i3c_master_add_i3c_dev_locked(&hci->master, next_addr);
> - if (ret)
> - break;
> + i3c_master_add_i3c_dev_locked(&hci->master, next_addr);
> }
>
> if (dat_idx >= 0)
> diff --git a/drivers/i3c/master/mipi-i3c-hci/cmd_v2.c b/drivers/i3c/master/mipi-i3c-hci/cmd_v2.c
> index 39eec26a363c..8d93748e858d 100644
> --- a/drivers/i3c/master/mipi-i3c-hci/cmd_v2.c
> +++ b/drivers/i3c/master/mipi-i3c-hci/cmd_v2.c
> @@ -296,9 +296,7 @@ static int hci_cmd_v2_daa(struct i3c_hci *hci)
> * TODO: Extend the subsystem layer to allow for registering
> * new device and provide BCR/DCR/PID at the same time.
> */
> - ret = i3c_master_add_i3c_dev_locked(&hci->master, next_addr);
> - if (ret)
> - break;
> + i3c_master_add_i3c_dev_locked(&hci->master, next_addr);
> }
>
> hci_free_xfer(xfer, 2);
> --
> 2.51.0
>