Re: [PATCH v2 4/5] i3c: master: Fix error codes at send_ccc_cmd

From: Jorge Marques

Date: Mon Mar 23 2026 - 12:51:14 EST


On Fri, Mar 13, 2026 at 08:45:37PM +0200, Adrian Hunter wrote:
> On 12/03/2026 18:38, Jorge Marques wrote:
> > i3c_master_send_ccc_cmd_locked would propagate cmd->err (positive,
> > Mx codes) to the ret variable, cascading down multiple methods until
> > reaching methods that explicitly stated they would return 0 on success
> > or negative error code. For example, the call chain:
> >
> > i3c_device_enable_ibi <- i3c_dev_enable_ibi_locked <-
> > master->ops.enable_ibi <- i3c_master_enec_locked <-
> > i3c_master_enec_disec_locked <- i3c_master_send_ccc_cmd_locked
> >
> > Fix this by returning the ret value, callers can
> > still read the cmd->err value if ret is negative.
> >
> > All corner cases where the Mx codes do need to be handled individually,
> > are resolved in previous commits. Those corner cases are all scenarios
> > when I3C_ERROR_M2 is expected and acceptable.
>
> There needs to be a simple way to ensure the essential
> prerequisite patches would be back ported also, if this
> patch is back ported. Could at least list their titles
> here e.g.
>
> The essential prerequisite patches for the fix are:
> i3c: master: Move rstdaa error suppression
> i3c: master: Move entdaa error suppression
> i3c: master: Move bus_init error suppression
>

Ack all e-mails.

Regards,
Jorge
> >
> > Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> > Closes: https://lore.kernel.org/linux-iio/aYXvT5FW0hXQwhm_@stanley.mountain/
> > Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
> > Signed-off-by: Jorge Marques <jorge.marques@xxxxxxxxxx>
>
> Otherwise:
>
> Reviewed-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
>