Re: [PATCH 1/5] i3c: master: Move rstdaa error suppression

From: Jorge Marques

Date: Tue Mar 10 2026 - 04:08:03 EST


On Mon, Mar 09, 2026 at 02:34:58PM +0200, Adrian Hunter wrote:
> On 09/03/2026 14:17, Jorge Marques wrote:
> > On Mon, Mar 09, 2026 at 01:39:36PM +0200, Adrian Hunter wrote:
> >> On 08/03/2026 18:47, Jorge Marques wrote:
> >>> --- a/drivers/i3c/master.c
> >>> +++ b/drivers/i3c/master.c
> >>> @@ -1016,6 +1016,10 @@ static int i3c_master_rstdaa_locked(struct i3c_master_controller *master,
> >>> ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
> >>> i3c_ccc_cmd_dest_cleanup(&dest);
> >>>
> >>> + /* No active devices on the bus. */
> >>> + if (ret && cmd.err == I3C_ERROR_M2)
> >>> + ret = 0;
> >>> +
> >>> return ret;
> >>> }
> >>>
> >>> @@ -1785,7 +1789,6 @@ i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)
> >>> */
> >>> int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa)
> >>> {
> >>> - int rstret = 0;
> >>> int ret;
> >>>
> >>> ret = i3c_master_rpm_get(master);
> >>> @@ -1795,9 +1798,9 @@ int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa)
> >>> i3c_bus_maintenance_lock(&master->bus);
> >>>
> >>> if (rstdaa) {
> >>> - rstret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
> >>> - if (rstret == I3C_ERROR_M2)
> >>> - rstret = 0;
> >>> + ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
> >>> + if (ret)
> >>> + goto out;
> >>
> >> This is an unrelated change. The original intention was to perform
> >> DAA even if RSTDAA fails. If you really want this, it needs to be
> >> a separate patch with separate justification.
> >>
> >>> }
> > Hi Adrian, handling I3C_ERROR_M2 is unchanged.
> >
> > The intention is to perform the DAA if the RSTDAA fail due to a
> > I3C_ERROR_M2, this behaviour is unchanged,
> No, the intention was as the code is written. DAA is done
> irrespective of whether RSTDAA fails. The behaviour has changed:
> before it always does DAA, after it does not always.
>

Hi Adrian, you are right, the og behaviour is to continue on any error.
v2 will bring the rstret back, thanks for pointing out! For context, did
you experience peripherals/controllers that failed with
err != I3C_ERROR_M2 on RSTDAA? Would be nice to map at least one
non-spec-conforming case.

Best regards,
Jorge