Skip to content

Commit 43bbc5f

Browse files
nxpfrankligregkh
authored andcommitted
i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin
commit 36faa04 upstream. When a new device hotjoins, a new dynamic address is assigned. i3c_master_add_i3c_dev_locked() identifies that the device was previously attached to the bus and locates the olddev. i3c_master_add_i3c_dev_locked() { ... olddev = i3c_master_search_i3c_dev_duplicate(newdev); ... if (olddev) { ... i3c_dev_disable_ibi_locked(olddev); ^^^^^^ The olddev should not receive any commands on the i3c bus as it does not exist and has been assigned a new address. This will result in NACK or timeout. So remove it. } i3c_dev_free_ibi_locked(olddev); ^^^^^^^^ This function internally calls i3c_dev_disable_ibi_locked() function causing to send DISEC command with old Address. The olddev should not receive any commands on the i3c bus as it does not exist and has been assigned a new address. This will result in NACK or timeout. So, update the olddev->ibi->enabled flag to false to avoid DISEC with OldAddr. } Include part of Ravindra Yashvant Shinde's work: https://lore.kernel.org/linux-i3c/[email protected]/T/#u Fixes: 317bacf ("i3c: master: add enable(disable) hot join in sys entry") Co-developed-by: Ravindra Yashvant Shinde <[email protected]> Signed-off-by: Ravindra Yashvant Shinde <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1baed36 commit 43bbc5f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/i3c/master.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,11 +2048,16 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
20482048
ibireq.max_payload_len = olddev->ibi->max_payload_len;
20492049
ibireq.num_slots = olddev->ibi->num_slots;
20502050

2051-
if (olddev->ibi->enabled) {
2051+
if (olddev->ibi->enabled)
20522052
enable_ibi = true;
2053-
i3c_dev_disable_ibi_locked(olddev);
2054-
}
2055-
2053+
/*
2054+
* The olddev should not receive any commands on the
2055+
* i3c bus as it does not exist and has been assigned
2056+
* a new address. This will result in NACK or timeout.
2057+
* So, update the olddev->ibi->enabled flag to false
2058+
* to avoid DISEC with OldAddr.
2059+
*/
2060+
olddev->ibi->enabled = false;
20562061
i3c_dev_free_ibi_locked(olddev);
20572062
}
20582063
mutex_unlock(&olddev->ibi_lock);

0 commit comments

Comments
 (0)