All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i3c: renesas: Don't register devices when ENTDAA times out
@ 2026-07-31  7:01 ` Tommaso Merciai
  0 siblings, 0 replies; 5+ messages in thread
From: Tommaso Merciai @ 2026-07-31  7:01 UTC (permalink / raw)
  To: tomm.merciai
  Cc: linux-renesas-soc, claudiu.beznea.uj, biju.das.jz,
	Tommaso Merciai, Wolfram Sang, Alexandre Belloni, Frank Li,
	linux-i3c, linux-kernel

renesas_i3c_daa() derives the number of newly assigned dynamic addresses
from cmd->rx_count, which the response ISR sets 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.

On a bus with no target connected the ENTDAA times out and the driver
registers RENESAS_I3C_MAX_DEVS devices that are not there, each costing
the core two seconds on a GETPID that can only time out:

  i3c i3c-0: Failed to add I3C device at address 9, error -110
  ...
  i3c i3c-0: Failed to add I3C device at address 16, error -110

Start from maxdevs instead: no address is assigned before ENTDAA runs,
and the existing rx_count >= maxdevs check then reports an empty bus.

Fixes: d028219a9f14 ("i3c: master: Add basic driver for the Renesas I3C controller")
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
 drivers/i3c/master/renesas-i3c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c
index 2b501f31e874..f4d9608978a9 100644
--- a/drivers/i3c/master/renesas-i3c.c
+++ b/drivers/i3c/master/renesas-i3c.c
@@ -685,7 +685,7 @@ static int renesas_i3c_daa(struct i3c_master_controller *m)
 
 	init_completion(&xfer->comp);
 	cmd = xfer->cmds;
-	cmd->rx_count = 0;
+	cmd->rx_count = i3c->maxdevs;
 
 	PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND(i3c->dev, pm);
 	ret = PM_RUNTIME_ACQUIRE_ERR(&pm);
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-31 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31  7:01 [PATCH] i3c: renesas: Don't register devices when ENTDAA times out Tommaso Merciai
2026-07-31  7:01 ` Tommaso Merciai
2026-07-31  7:18 ` sashiko-bot
2026-07-31 16:12 ` Claudiu Beznea
2026-07-31 16:12   ` Claudiu Beznea

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.