Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i3c: master: Move entdaa 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.
The CCC ENTDAA is invoked with i3c_master_entdaa_locked() and yields
error I3C_ERROR_M2 if there are no devices active on the bus. Some
controllers may also yield if there are no more devices need an dynamic
address, since the sequence do always end in a NACK. Handle inside
i3c_master_entdaa_locked(), checking cmd->err directly. Both call sites
are updated, adi_i3c_master_do_daa() and cdns_i3c_master_do_daa().

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-2-30bdc68004be@analog.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Jorge Marques and committed by
Alexandre Belloni
42247fff 19a1b61f

+6 -3
+4
drivers/i3c/master.c
··· 1077 1077 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); 1078 1078 i3c_ccc_cmd_dest_cleanup(&dest); 1079 1079 1080 + /* No active devices need an address. */ 1081 + if (ret && cmd.err == I3C_ERROR_M2) 1082 + ret = 0; 1083 + 1080 1084 return ret; 1081 1085 } 1082 1086 EXPORT_SYMBOL_GPL(i3c_master_entdaa_locked);
+1 -2
drivers/i3c/master/adi-i3c-master.c
··· 655 655 656 656 writel(irq_mask, master->regs + REG_IRQ_MASK); 657 657 658 - /* DAA always finishes with CE2_ERROR or NACK_RESP */ 659 - if (ret && ret != I3C_ERROR_M2) 658 + if (ret) 660 659 return ret; 661 660 662 661 /* Add I3C devices discovered */
+1 -1
drivers/i3c/master/i3c-master-cdns.c
··· 1143 1143 } 1144 1144 1145 1145 ret = i3c_master_entdaa_locked(&master->base); 1146 - if (ret && ret != I3C_ERROR_M2) 1146 + if (ret) 1147 1147 return ret; 1148 1148 1149 1149 newdevs = readl(master->regs + DEVS_CTRL) & DEVS_CTRL_DEVS_ACTIVE_MASK;