i3c: master: Disable slave events before RSTDAA
Subsystems (2)
PATCH 1/1 i3c: master: Disable slave events before RSTDAA
Bus initialization sends RSTDAA before disabling slave events. A hot-join or other slave event may occur after RSTDAA and interfere with the following DISEC command or the remaining initialization.
Send broadcast DISEC before RSTDAA to disable SIR, master request, and hot-join events before resetting dynamic addresses. This prevents slave events from disrupting bus initialization.
--- drivers/i3c/master.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/i3c/master.c +8 -8
@@ -2571,10 +2571,12 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Reset all dynamic address that may have been assigned before -* (assigned by the bootloader for example). +* Disable all slave events before starting DAA. When no active device +* is on the bus, returns Mx error code M2, this error is ignored. */ - ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR ); + ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, +I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | +I3C_CCC_EVENT_HJ , true);if (ret) goto err_bus_cleanup;
@@ -2585,12 +2587,10 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Disable all slave events before starting DAA. When no active device -* is on the bus, returns Mx error code M2, this error is ignored. +* Reset all dynamic address that may have been assigned before +* (assigned by the bootloader for example). */ - ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, -I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | -I3C_CCC_EVENT_HJ , true); + ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR );if (ret) goto err_bus_cleanup;
Signature · 1 line
2.43.0
Quoted 8 lines · Defa Li
Bus initialization sends RSTDAA before disabling slave events. A hot-join or other slave event may occur after RSTDAA and interfere with the following DISEC command or the remaining initialization.
Send broadcast DISEC before RSTDAA to disable SIR, master request, and hot-join events before resetting dynamic addresses. This prevents slave events from disrupting bus initialization.
While the sequence you suggested making sense to me, but i am wondering before bus_init, are there really a target device getting powered up who can generate hotjoin ?
MY understanding is, post master registration and bus_init only target devices should start life, isn't it ?
Quoted 41 lines
Signed-off-by Defa Li <[email protected]>--- drivers/i3c/master.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)drivers/i3c/master.c +8
-8@@ -2571,10 +2571,12 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Reset all dynamic address that may have been assigned before -* (assigned by the bootloader for example). +* Disable all slave events before starting DAA. When no active device +* is on the bus, returns Mx error code M2, this error is ignored. */ - ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR ); + ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, +I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | +I3C_CCC_EVENT_HJ , true);if (ret) goto err_bus_cleanup;@@ -2585,12 +2587,10 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Disable all slave events before starting DAA. When no active device -* is on the bus, returns Mx error code M2, this error is ignored. +* Reset all dynamic address that may have been assigned before +* (assigned by the bootloader for example). */ - ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, -I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | -I3C_CCC_EVENT_HJ , true); + ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR );if (ret) goto err_bus_cleanup;
Quoted 10 lines · Defa Li
Bus initialization sends RSTDAA before disabling slave events. A hot-join or other slave event may occur after RSTDAA and interfere with the following DISEC command or the remaining initialization.
Send broadcast DISEC before RSTDAA to disable SIR, master request, and hot-join events before resetting dynamic addresses. This prevents slave events from disrupting bus initialization.
Signed-off-by Defa Li <[email protected]>---
Quoted 42 lines
drivers/i3c/master.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)drivers/i3c/master.c +8
-9@@ -2571,10 +2571,12 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Reset all dynamic address that may have been assigned before -* (assigned by the bootloader for example). +* Disable all slave events before starting DAA. When no active device +* is on the bus, returns Mx error code M2, this error is ignored. */ - ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR ); + ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, +I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | +I3C_CCC_EVENT_HJ , true);if (ret) goto err_bus_cleanup;@@ -2585,12 +2587,10 @@ static int i3c_master_bus_init(struct i3c_master_controller *master) }/* -* Disable all slave events before starting DAA. When no active device -* is on the bus, returns Mx error code M2, this error is ignored. +* Reset all dynamic address that may have been assigned before +* (assigned by the bootloader for example). */ - ret =i3c_master_enec_disec_locked (master,I3C_BROADCAST_ADDR , false, -I3C_CCC_EVENT_SIR |I3C_CCC_EVENT_MR | -I3C_CCC_EVENT_HJ , true); + ret =i3c_master_rstdaa_locked (master,I3C_BROADCAST_ADDR );if (ret) goto err_bus_cleanup; --2.43.0