Skip to content

Commit c6a7550

Browse files
Aniketalexandrebelloni
authored andcommitted
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. Signed-off-by: Aniket <aniketmaurya@google.com> Link: https://lore.kernel.org/r/20230822051938.2852567-1-aniketmaurya@google.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 32e6b31 commit c6a7550

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/i3c/master.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,11 @@ static int i3c_master_get_i3c_addrs(struct i3c_dev_desc *dev)
13081308
if (dev->info.static_addr) {
13091309
status = i3c_bus_get_addr_slot_status(&master->bus,
13101310
dev->info.static_addr);
1311-
if (status != I3C_ADDR_SLOT_FREE)
1311+
/* Since static address and assigned dynamic address can be
1312+
* equal, allow this case to pass.
1313+
*/
1314+
if (status != I3C_ADDR_SLOT_FREE &&
1315+
dev->info.static_addr != dev->boardinfo->init_dyn_addr)
13121316
return -EBUSY;
13131317

13141318
i3c_bus_set_addr_slot_status(&master->bus,

0 commit comments

Comments
 (0)