* [PATCH v3] i3c: dw: reduce do_daa time if there's no client
@ 2026-08-19 4:48 Jisheng Zhang
2026-08-19 11:52 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2026-08-19 4:48 UTC (permalink / raw)
To: Alexandre Belloni, Frank Li; +Cc: linux-i3c, linux-kernel
dw_i3c_master_daa() derives the number of newly assigned dynamic
addresses from cmd->rx_len, the ISR sets it to the number of address
slots ENTDAA left unassigned. It starts out as zero, which already
means "every address was assigned", so a timed out transfer leaves
that value in place and it gets used as a result.
If there's no client connected, the addr assign cmd times out, then
the driver calls i3c_master_add_i3c_dev_locked() to add devices that
are not there, each costing about 1s, thus adds non necessary boot
time up to (maxdev * 1)s.
Start from maxdevs instead: no address is assigned before ENTDAA runs,
and the existing rx_count >= maxdevs check then reports an empty bus.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
since v2:
- rebase on the lastest i3c/next
- collect Reviewed-by tag
since v1:
- use another method to remove the non-necessary calling of
i3c_master_add_i3c_dev_locked() if there's no client
- update commit msg
drivers/i3c/master/dw-i3c-master.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 0a3799a4ce87..4563d8761ba0 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -921,6 +921,7 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
goto rpm_out;
}
cmd = &xfer->cmds[0];
+ cmd->rx_len = master->maxdevs;
cmd->cmd_hi = COMMAND_PORT_TRANSFER_ARG;
cmd->cmd_lo = COMMAND_PORT_DEV_COUNT(master->maxdevs - pos) |
COMMAND_PORT_DEV_INDEX(pos) |
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] i3c: dw: reduce do_daa time if there's no client
2026-08-19 4:48 [PATCH v3] i3c: dw: reduce do_daa time if there's no client Jisheng Zhang
@ 2026-08-19 11:52 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2026-08-19 11:52 UTC (permalink / raw)
To: Frank Li, Jisheng Zhang; +Cc: linux-i3c, linux-kernel
On Wed, 19 Aug 2026 12:48:33 +0800, Jisheng Zhang wrote:
> dw_i3c_master_daa() derives the number of newly assigned dynamic
> addresses from cmd->rx_len, the ISR sets it to the number of address
> slots ENTDAA left unassigned. It starts out as zero, which already
> means "every address was assigned", so a timed out transfer leaves
> that value in place and it gets used as a result.
>
> If there's no client connected, the addr assign cmd times out, then
> the driver calls i3c_master_add_i3c_dev_locked() to add devices that
> are not there, each costing about 1s, thus adds non necessary boot
> time up to (maxdev * 1)s.
>
> [...]
Applied, thanks!
[1/1] i3c: dw: reduce do_daa time if there's no client
https://git.kernel.org/i3c/c/cab40cfc9e11
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-19 11:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19 4:48 [PATCH v3] i3c: dw: reduce do_daa time if there's no client Jisheng Zhang
2026-08-19 11:52 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®