From: Frank Li <Frank.li@nxp.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: alexandre.belloni@bootlin.com, linux-i3c@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] i3c: master: Consolidate Hot-Join DAA work in the core
Date: Tue, 12 May 2026 12:16:08 -0400 [thread overview]
Message-ID: <agNSSNaIf5GI_yoP@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260512121732.406009-4-adrian.hunter@intel.com>
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@intel.com>
> ---
Thank you for do such consolidate work.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
next prev parent reply other threads:[~2026-05-12 16:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 12:17 [PATCH 0/8] i3c: Hot-Join improvements and MIPI HCI Hot-Join support Adrian Hunter
2026-05-12 12:17 ` [PATCH 1/8] i3c: master: Make hot-join workqueue freezable to block hot-join during suspend Adrian Hunter
2026-05-12 16:09 ` Frank Li
2026-05-12 12:17 ` [PATCH 2/8] i3c: master: Serialize i3c_set_hotjoin() with the maintenance lock Adrian Hunter
2026-05-12 16:11 ` Frank Li
2026-05-12 19:42 ` David Nyström
2026-05-12 12:17 ` [PATCH 3/8] i3c: master: Consolidate Hot-Join DAA work in the core Adrian Hunter
2026-05-12 16:16 ` Frank Li [this message]
2026-05-12 12:17 ` [PATCH 4/8] i3c: master: Ensure Hot-Join operations are stopped on shutdown Adrian Hunter
2026-05-12 16:27 ` Frank Li
2026-05-12 12:17 ` [PATCH 5/8] i3c: dw: Drop redundant Hot-Join cancel_work_sync() in shutdown Adrian Hunter
2026-05-12 16:30 ` Frank Li
2026-05-12 12:17 ` [PATCH 6/8] i3c: master: Defer new-device registration out of DAA caller context Adrian Hunter
2026-05-12 16:39 ` Frank Li
2026-05-12 12:17 ` [PATCH 7/8] i3c: master: Export i3c_master_enec_disec_locked() Adrian Hunter
2026-05-12 16:31 ` Frank Li
2026-05-12 12:17 ` [PATCH 8/8] i3c: mipi-i3c-hci: Add Hot-Join support Adrian Hunter
2026-05-12 16:34 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agNSSNaIf5GI_yoP@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=adrian.hunter@intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox