* [PATCH] i3c: dw: reduce do_daa time if there's no client
@ 2026-08-03 14:03 Jisheng Zhang
2026-08-05 20:05 ` Frank Li
0 siblings, 1 reply; 5+ messages in thread
From: Jisheng Zhang @ 2026-08-03 14:03 UTC (permalink / raw)
To: Alexandre Belloni, Frank Li; +Cc: linux-i3c, linux-kernel
If there's no client, wait for completion will timeout, then there's no
need to add i3c dev at all. This can save boot time by ~6s if there's
no client connected to the i3c interface.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/i3c/master/dw-i3c-master.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 0625587f1527..18ebf304029a 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -885,8 +885,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
COMMAND_PORT_ROC;
dw_i3c_master_enqueue_xfer(master, xfer);
- if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
+ if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) {
dw_i3c_master_dequeue_xfer(master, xfer);
+ goto rpm_out;
+ }
newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0);
newdevs &= ~olddevs;
--
2.53.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i3c: dw: reduce do_daa time if there's no client
2026-08-03 14:03 [PATCH] i3c: dw: reduce do_daa time if there's no client Jisheng Zhang
@ 2026-08-05 20:05 ` Frank Li
2026-08-13 4:56 ` Jisheng Zhang
0 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2026-08-05 20:05 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
On Mon, Aug 03, 2026 at 10:03:07PM +0800, Jisheng Zhang wrote:
> If there's no client, wait for completion will timeout, then there's no
> need to add i3c dev at all. This can save boot time by ~6s if there's
> no client connected to the i3c interface.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> drivers/i3c/master/dw-i3c-master.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 0625587f1527..18ebf304029a 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -885,8 +885,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
> COMMAND_PORT_ROC;
>
> dw_i3c_master_enqueue_xfer(master, xfer);
> - if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
> + if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) {
> dw_i3c_master_dequeue_xfer(master, xfer);
> + goto rpm_out;
not sure why save 6s. timeout already happen, does register i3c device
takes 6s?
And if do_daa find 3 devices, then timeout, you skip register found 3
devices.
Frank
> + }
>
> newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0);
> newdevs &= ~olddevs;
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i3c: dw: reduce do_daa time if there's no client
2026-08-05 20:05 ` Frank Li
@ 2026-08-13 4:56 ` Jisheng Zhang
2026-08-13 20:45 ` Frank Li
0 siblings, 1 reply; 5+ messages in thread
From: Jisheng Zhang @ 2026-08-13 4:56 UTC (permalink / raw)
To: Frank Li; +Cc: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
On Wed, Aug 05, 2026 at 04:05:35PM -0400, Frank Li wrote:
> On Mon, Aug 03, 2026 at 10:03:07PM +0800, Jisheng Zhang wrote:
> > If there's no client, wait for completion will timeout, then there's no
> > need to add i3c dev at all. This can save boot time by ~6s if there's
> > no client connected to the i3c interface.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> > drivers/i3c/master/dw-i3c-master.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> > index 0625587f1527..18ebf304029a 100644
> > --- a/drivers/i3c/master/dw-i3c-master.c
> > +++ b/drivers/i3c/master/dw-i3c-master.c
> > @@ -885,8 +885,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
> > COMMAND_PORT_ROC;
> >
> > dw_i3c_master_enqueue_xfer(master, xfer);
> > - if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
> > + if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) {
> > dw_i3c_master_dequeue_xfer(master, xfer);
> > + goto rpm_out;
>
> not sure why save 6s. timeout already happen, does register i3c device
> takes 6s?
sorry, typo, s/6/4
For example if the maxdev == 4, when there's no i3c device connected, the
max cmd->rx_len = 0 after timeout, then newdevs = 0xf, then go through
the i3c_master_add_i3c_dev_locked(), each take ~1s, so adds up to 4s
>
> And if do_daa find 3 devices, then timeout, you skip register found 3
> devices.
It's the addr assign cmd timeout, so if 3 devices respond, the addr
assign cmd won't timeout.
>
> Frank
>
> > + }
> >
> > newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0);
> > newdevs &= ~olddevs;
> > --
> > 2.53.0
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i3c: dw: reduce do_daa time if there's no client
2026-08-13 4:56 ` Jisheng Zhang
@ 2026-08-13 20:45 ` Frank Li
2026-08-14 3:52 ` Jisheng Zhang
0 siblings, 1 reply; 5+ messages in thread
From: Frank Li @ 2026-08-13 20:45 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
On Thu, Aug 13, 2026 at 12:56:09PM +0800, Jisheng Zhang wrote:
> On Wed, Aug 05, 2026 at 04:05:35PM -0400, Frank Li wrote:
> > On Mon, Aug 03, 2026 at 10:03:07PM +0800, Jisheng Zhang wrote:
> > > If there's no client, wait for completion will timeout, then there's no
> > > need to add i3c dev at all. This can save boot time by ~6s if there's
> > > no client connected to the i3c interface.
> > >
> > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > ---
> > > drivers/i3c/master/dw-i3c-master.c | 4 +++-
> > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> > > index 0625587f1527..18ebf304029a 100644
> > > --- a/drivers/i3c/master/dw-i3c-master.c
> > > +++ b/drivers/i3c/master/dw-i3c-master.c
> > > @@ -885,8 +885,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
> > > COMMAND_PORT_ROC;
> > >
> > > dw_i3c_master_enqueue_xfer(master, xfer);
> > > - if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
> > > + if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) {
> > > dw_i3c_master_dequeue_xfer(master, xfer);
> > > + goto rpm_out;
> >
> > not sure why save 6s. timeout already happen, does register i3c device
> > takes 6s?
>
> sorry, typo, s/6/4
> For example if the maxdev == 4, when there's no i3c device connected, the
> max cmd->rx_len = 0 after timeout, then newdevs = 0xf, then go through
> the i3c_master_add_i3c_dev_locked(), each take ~1s, so adds up to 4s
https://lore.kernel.org/linux-i3c/20260731070150.2519825-1-tommaso.merciai.xr@bp.renesas.com/
Need fix newdevs, it should be 0, not 0xf.
Frank
>
> >
> > And if do_daa find 3 devices, then timeout, you skip register found 3
> > devices.
>
> It's the addr assign cmd timeout, so if 3 devices respond, the addr
> assign cmd won't timeout.
>
> >
> > Frank
> >
> > > + }
> > >
> > > newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0);
> > > newdevs &= ~olddevs;
> > > --
> > > 2.53.0
> > >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] i3c: dw: reduce do_daa time if there's no client
2026-08-13 20:45 ` Frank Li
@ 2026-08-14 3:52 ` Jisheng Zhang
0 siblings, 0 replies; 5+ messages in thread
From: Jisheng Zhang @ 2026-08-14 3:52 UTC (permalink / raw)
To: Frank Li; +Cc: Alexandre Belloni, Frank Li, linux-i3c, linux-kernel
On Thu, Aug 13, 2026 at 04:45:00PM -0400, Frank Li wrote:
> On Thu, Aug 13, 2026 at 12:56:09PM +0800, Jisheng Zhang wrote:
> > On Wed, Aug 05, 2026 at 04:05:35PM -0400, Frank Li wrote:
> > > On Mon, Aug 03, 2026 at 10:03:07PM +0800, Jisheng Zhang wrote:
> > > > If there's no client, wait for completion will timeout, then there's no
> > > > need to add i3c dev at all. This can save boot time by ~6s if there's
> > > > no client connected to the i3c interface.
> > > >
> > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > > ---
> > > > drivers/i3c/master/dw-i3c-master.c | 4 +++-
> > > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> > > > index 0625587f1527..18ebf304029a 100644
> > > > --- a/drivers/i3c/master/dw-i3c-master.c
> > > > +++ b/drivers/i3c/master/dw-i3c-master.c
> > > > @@ -885,8 +885,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m)
> > > > COMMAND_PORT_ROC;
> > > >
> > > > dw_i3c_master_enqueue_xfer(master, xfer);
> > > > - if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT))
> > > > + if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) {
> > > > dw_i3c_master_dequeue_xfer(master, xfer);
> > > > + goto rpm_out;
> > >
> > > not sure why save 6s. timeout already happen, does register i3c device
> > > takes 6s?
> >
> > sorry, typo, s/6/4
> > For example if the maxdev == 4, when there's no i3c device connected, the
> > max cmd->rx_len = 0 after timeout, then newdevs = 0xf, then go through
> > the i3c_master_add_i3c_dev_locked(), each take ~1s, so adds up to 4s
>
>
> https://lore.kernel.org/linux-i3c/20260731070150.2519825-1-tommaso.merciai.xr@bp.renesas.com/
>
> Need fix newdevs, it should be 0, not 0xf.
Aha, this method also works. Let me cook a new version
Thanks a lot
>
> Frank
>
> >
> > >
> > > And if do_daa find 3 devices, then timeout, you skip register found 3
> > > devices.
> >
> > It's the addr assign cmd timeout, so if 3 devices respond, the addr
> > assign cmd won't timeout.
> >
> > >
> > > Frank
> > >
> > > > + }
> > > >
> > > > newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0);
> > > > newdevs &= ~olddevs;
> > > > --
> > > > 2.53.0
> > > >
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-08-14 4:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-03 14:03 [PATCH] i3c: dw: reduce do_daa time if there's no client Jisheng Zhang
2026-08-05 20:05 ` Frank Li
2026-08-13 4:56 ` Jisheng Zhang
2026-08-13 20:45 ` Frank Li
2026-08-14 3:52 ` Jisheng Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®