Skip to content

Commit 19a1b61

Browse files
gastmaieralexandrebelloni
authored andcommitted
i3c: master: Move rstdaa error suppression
Prepare to fix improper Mx positive error propagation in later commits by handling Mx error codes where the i3c_ccc_cmd command is allocated. Two of the four i3c_master_rstdaa_locked() are error paths that already suppressed the return value, the remaining two are changed to handle the I3C_ERROR_M2 Mx error code inside i3c_master_rstdaa_locked(), checking cmd->err directly. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Jorge Marques <jorge.marques@analog.com> Link: https://patch.msgid.link/20260323-ad4062-positive-error-fix-v3-1-30bdc68004be@analog.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 6105f49 commit 19a1b61

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

drivers/i3c/master.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,10 @@ static int i3c_master_rstdaa_locked(struct i3c_master_controller *master,
10431043
ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
10441044
i3c_ccc_cmd_dest_cleanup(&dest);
10451045

1046+
/* No active devices on the bus. */
1047+
if (ret && cmd.err == I3C_ERROR_M2)
1048+
ret = 0;
1049+
10461050
return ret;
10471051
}
10481052

@@ -1821,11 +1825,8 @@ int i3c_master_do_daa_ext(struct i3c_master_controller *master, bool rstdaa)
18211825

18221826
i3c_bus_maintenance_lock(&master->bus);
18231827

1824-
if (rstdaa) {
1828+
if (rstdaa)
18251829
rstret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
1826-
if (rstret == I3C_ERROR_M2)
1827-
rstret = 0;
1828-
}
18291830

18301831
ret = master->ops->do_daa(master);
18311832

@@ -2120,7 +2121,7 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
21202121
* (assigned by the bootloader for example).
21212122
*/
21222123
ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR);
2123-
if (ret && ret != I3C_ERROR_M2)
2124+
if (ret)
21242125
goto err_bus_cleanup;
21252126

21262127
if (master->ops->set_speed) {

0 commit comments

Comments
 (0)