Message ID | 20241107132549.25439-1-defa.li@mediatek.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [v2] i3c: Use i3cdev->desc->info instead of calling i3c_device_get_info() to avoid deadlock | expand |
On Thu, 07 Nov 2024 21:25:39 +0800, mtk25126 wrote: > A deadlock may happen since the i3c_master_register() acquires > &i3cbus->lock twice. See the log below. > Use i3cdev->desc->info instead of calling i3c_device_info() to > avoid acquiring the lock twice. > > v2: > - Modified the title and commit message > > [...] Applied, thanks! [1/1] i3c: Use i3cdev->desc->info instead of calling i3c_device_get_info() to avoid deadlock https://git.kernel.org/abelloni/c/6cf7b65f7029 Best regards,
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 6f3eb710a75d..bb8a8bf0c4c7 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -282,7 +282,8 @@ static int i3c_device_uevent(const struct device *dev, struct kobj_uevent_env *e struct i3c_device_info devinfo; u16 manuf, part, ext; - i3c_device_get_info(i3cdev, &devinfo); + if (i3cdev->desc) + devinfo = i3cdev->desc->info; manuf = I3C_PID_MANUF_ID(devinfo.pid); part = I3C_PID_PART_ID(devinfo.pid); ext = I3C_PID_EXTRA_INFO(devinfo.pid);