[RFC PATCH 2/2] i3c: master: Propagate SETAASA early device-add failures

Nirmoy Das <[email protected]>
Newsgroups org.infradead.lists.linux-i3c,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
i3c_master_bus_init() ignores errors from
i3c_master_early_i3c_dev_add(). This is recoverable for SETDASA devices
because they can be discovered later through ENTDAA.

SETAASA devices do not participate in ENTDAA. If their early attach or
reattach fails, bus initialization still sends the SETAASA broadcast and
continues without registering the device. The target may consequently
have an active address without a corresponding I3C device.

Abort bus initialization when early device registration fails for a
SETAASA device. Preserve the existing fallback behavior for other static
address methods.

Fixes: bbaf8733b848 ("i3c: master: Add support for devices using SETAASA")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Nirmoy Das <[email protected]>
---
 drivers/i3c/master.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 922da77cbdf324..7a83f39448e8ed 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2537,8 +2537,12 @@ static int i3c_master_bus_init(struct i3c_master_controller *master)
 		 * addressable.
 		 */
 
-		if (i3cboardinfo->static_addr)
-			i3c_master_early_i3c_dev_add(master, i3cboardinfo);
+		if (i3cboardinfo->static_addr) {
+			ret = i3c_master_early_i3c_dev_add(master, i3cboardinfo);
+			if (ret && (i3cboardinfo->static_addr_method &
+				    I3C_ADDR_METHOD_SETAASA))
+				goto err_rstdaa;
+		}
 	}
 
 	/*
-- 
2.43.0


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.