Skip to contentSkip to conversation

i3c: master: Fix SETDASA process

PATCH Applied Aniket 2 participants 2 messages Aug 22, 2023 – Aug 27, 2023 I3C

lore
Share & tools
lore

Aniket

author
#0 lore raw

PATCH 1/1 i3c: master: Fix SETDASA process

When a I3C DT node has a static_addr and an init_dyn_addr,the init_dyn_addr is reserved in i3c_master_bus_init() and then the static_addr is reserved in i3c_master_early_i3c_dev_add(). But if the dynamic address is same as static then above procedure would fail.
Add a check to pass i3c_bus_get_addr_slot_status() when static and dynamic address are equal.

---
 drivers/i3c/master.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/i3c/master.c +5 -1
index 08aeb69a7800..87283e4a4607 100644
@@ -1308,7 +1308,11 @@ static int i3c_master_get_i3c_addrs(struct i3c_dev_desc *dev)
 	if (dev->info.static_addr) {
 		status = i3c_bus_get_addr_slot_status(&master->bus,
 						      dev->info.static_addr);
-		if (status != I3C_ADDR_SLOT_FREE)
+		/* Since static address and assigned dynamic address can be
+		 * equal, allow this case to pass.
+		 */
+		if (status != I3C_ADDR_SLOT_FREE &&
+		    dev->info.static_addr != dev->boardinfo->init_dyn_addr)
 			return -EBUSY;
 
 		i3c_bus_set_addr_slot_status(&master->bus,
Signature · 7 lines
2.42.0.rc1.204.g551eb34607-goog


-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c
maintainer Applied
#1 lore raw
Quoted 9 lines · Aniket

When a I3C DT node has a static_addr and an init_dyn_addr,the init_dyn_addr is reserved in i3c_master_bus_init() and then the static_addr is reserved in i3c_master_early_i3c_dev_add(). But if the dynamic address is same as static then above procedure would fail.
Add a check to pass i3c_bus_get_addr_slot_status() when static and dynamic address are equal.

[...]

Applied, thanks!

[1/1] i3c: master: Fix SETDASA process

      commit: c6a7550458922181bb922863d5f5feaf3c453fe5

Best regards,

Signature · 8 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-- 
linux-i3c mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-i3c