From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A06E33B6D6 for ; Fri, 14 Aug 2026 04:12:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786680726; cv=none; b=rLXP1UyfUbJNXEpOGQtt5ErXpURA9ZyEbVQlcKMVicOHeJNPF1YjeoX/fJ5EL9EGgTpOq3qVgecUhFE+5GuxBuXly985ujxriH14O0HzDyyrMx1m3sOKZmySDkrsC99fg4i41weXju1WP4mLd/C5WLqXRWSUBLx6Js+SIiKZY9w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786680726; c=relaxed/simple; bh=rTlqhiyAt+qZ77KYHL1GlNcSi6a8dkrG9J/3GgjmvNc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=amYe36JlKvY9s6EYuUklkU6i5OaoTWtt2f095fVZlyFcS5aYQqUP48X+iI5h/0i+kOMKvVVupRH342+uIGE64iZRPvM9yLkMK01FsUQ0VuPQ8vKzf02M7CmVDXodigWezlL5yF2F8is1q9sa7NfXfZo83dcEG1e2yHtYoXMRkjI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oJgcMB5E; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oJgcMB5E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BB221F000E9; Fri, 14 Aug 2026 04:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786680725; bh=Pni2X7y+Tl1FfQx/53ybaNDthZKqMBIr5x/5GnEArvs=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oJgcMB5E6D53C4E8DyZLR7rjpSN7ii3C1pNPkdGArdUWdcCOHyybJYJYN3t71o5P8 dgrDIG59kcrma10ODEyjeq0JY9Ye3jvQh+KCbhprzl9J/PWz2XmlAfO9NXOJCeCT0O onUrCIL6Z7dItZebV+RiVqpZDrtMthXNJ4j9TI8e9PDYjRq2WqhzSaJYnR6k/P7lQu TuiBJZtiboV7fgqA3EaE15x+w2hQCL37A2XWZqRMXWUCEHPUlnM0ixFguZVm9/Yf+1 cgNBIWCXkjZBH43tU4tEI/QSWkEw2yXwAIwjCudtwiuPlPY0ccHedlQb49BRUuxYP3 2UukKnxqtorog== Date: Fri, 14 Aug 2026 11:52:27 +0800 From: Jisheng Zhang To: Frank Li Cc: Alexandre Belloni , Frank Li , linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i3c: dw: reduce do_daa time if there's no client Message-ID: References: <20260803140307.12665-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 > > > > --- > > > > 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 > > > >