Message ID | 20241001162232.223724-1-Frank.Li@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v5,1/1] i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin | expand |
On Tue, 01 Oct 2024 12:22:32 -0400, Frank Li wrote: > 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. > } > > [...] Applied, thanks! [1/1] i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin https://git.kernel.org/abelloni/c/36faa04ce3d9 Best regards,
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 7028f03c2c42e..82f031928e413 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2039,11 +2039,16 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, ibireq.max_payload_len = olddev->ibi->max_payload_len; ibireq.num_slots = olddev->ibi->num_slots; - if (olddev->ibi->enabled) { + if (olddev->ibi->enabled) enable_ibi = true; - 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, update the olddev->ibi->enabled flag to false + * to avoid DISEC with OldAddr. + */ + olddev->ibi->enabled = false; i3c_dev_free_ibi_locked(olddev); } mutex_unlock(&olddev->ibi_lock);