[PATCH 3/8] i3c: master: Consolidate Hot-Join DAA work in the core

Frank Li Frank.li at nxp.com
Tue May 12 09:16:08 PDT 2026


On Tue, May 12, 2026 at 03:17:27PM +0300, Adrian Hunter wrote:
> Three master drivers (dw-i3c-master, i3c-master-cdns, svc-i3c-master)
> each carry an essentially identical Hot-Join handler: a struct
> work_struct embedded in their private state, a work function that just
> calls i3c_master_do_daa() on the embedded i3c_master_controller, plus
> matching INIT_WORK()/cancel_work_sync() boilerplate in probe/remove (and
> shutdown for dw-i3c). The IBI/ISR paths then queue that work onto
> master->wq, which already lives in the core.
>
> Move this pattern into the I3C core:
>
>  - Add struct work_struct hj_work to struct i3c_master_controller and
>    initialise it in i3c_master_register() with a core-provided handler
>    i3c_master_hj_work_fn() that performs i3c_master_do_daa().
>  - Cancel the work in i3c_master_unregister() so all controllers get
>    correct teardown ordering against the workqueue for free.
>  - Export i3c_master_queue_hotjoin() as the single entry point drivers
>    call from their Hot-Join IBI handler.
>
> Convert the three existing users to the new API: drop their private
> hj_work fields, work functions, INIT_WORK() and cancel_work_sync()
> calls, and replace the queue_work(master->wq, &drv->hj_work) call sites
> with i3c_master_queue_hotjoin(&drv->base). The dw-i3c shutdown path
> still needs to flush pending Hot-Join work before tearing down the
> hardware, so it is updated to cancel master->base.hj_work directly.
>
> No functional change intended: the work is still queued on the same
> master->wq, runs the same i3c_master_do_daa(), and is cancelled at
> controller teardown.  Future Hot-Join improvements now only need to
> be made in one place.
>
> Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
> ---

Thank you for do such consolidate work.

Reviewed-by: Frank Li <Frank.Li at nxp.com>

>



More information about the linux-i3c mailing list