Skip to content

Commit 36faa04

Browse files
nxpfranklialexandrebelloni
authored andcommitted
i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin
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/20240820151917.3904956-1-ravindra.yashvant.shinde@nxp.com/T/#u Fixes: 317bacf ("i3c: master: add enable(disable) hot join in sys entry") Co-developed-by: Ravindra Yashvant Shinde <ravindra.yashvant.shinde@nxp.com> Signed-off-by: Ravindra Yashvant Shinde <ravindra.yashvant.shinde@nxp.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20241001162232.223724-1-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 3b2ac81 commit 36faa04

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
@@ -2088,11 +2088,16 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master,
20882088
ibireq.max_payload_len = olddev->ibi->max_payload_len;
20892089
ibireq.num_slots = olddev->ibi->num_slots;
20902090

2091-
if (olddev->ibi->enabled) {
2091+
if (olddev->ibi->enabled)
20922092
enable_ibi = true;
2093-
i3c_dev_disable_ibi_locked(olddev);
2094-
}
2095-
2093+
/*
2094+
* The olddev should not receive any commands on the
2095+
* i3c bus as it does not exist and has been assigned
2096+
* a new address. This will result in NACK or timeout.
2097+
* So, update the olddev->ibi->enabled flag to false
2098+
* to avoid DISEC with OldAddr.
2099+
*/
2100+
olddev->ibi->enabled = false;
20962101
i3c_dev_free_ibi_locked(olddev);
20972102
}
20982103
mutex_unlock(&olddev->ibi_lock);

0 commit comments

Comments
 (0)