Skip to content

Commit e9645cf

Browse files
nxpfrankligregkh
authored andcommitted
i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin
commit 36faa04ce3d9c962b4b29d285ad07ca29e2988e4 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: 317bacf960a4 ("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 7f5c20b commit e9645cf

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
@@ -2031,11 +2031,16 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
20312031
ibireq.max_payload_len = olddev->ibi->max_payload_len;
20322032
ibireq.num_slots = olddev->ibi->num_slots;
20332033

2034-
if (olddev->ibi->enabled) {
2034+
if (olddev->ibi->enabled)
20352035
enable_ibi = true;
2036-
i3c_dev_disable_ibi_locked(olddev);
2037-
}
2038-
2036+
/*
2037+
* The olddev should not receive any commands on the
2038+
* i3c bus as it does not exist and has been assigned
2039+
* a new address. This will result in NACK or timeout.
2040+
* So, update the olddev->ibi->enabled flag to false
2041+
* to avoid DISEC with OldAddr.
2042+
*/
2043+
olddev->ibi->enabled = false;
20392044
i3c_dev_free_ibi_locked(olddev);
20402045
}
20412046
mutex_unlock(&olddev->ibi_lock);

0 commit comments

Comments
 (0)