From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 0DAB223D295 for ; Tue, 18 Aug 2026 21:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787087894; cv=none; b=U3a3DFPt2eREeIwXSSGUjn+V5aEo5YqPaWpqmuY1jsI2U4u7361t6Kkb/tiIVW+A+XCH9yKKyL6kFbs8wlf/112zY4G5h+xRp6wbUVGIt0+TCmqXldSwz1mYKRDrFSSZ1wohw1yC3MA3zKW3f3GQdPEGiDkb5RDDvDWxBQCuHpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787087894; c=relaxed/simple; bh=i4e+cg8hYaC3ztIDDRqvIWz58FE0xFQYTx2qEaIV8Eo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c2pfjal57laftYzPGooRPtN2xq0oWttOXMyyXqUZovUtbYcOGKCQGodBO6968qeeFA1t3FEIC9BQJUdnHGLB02jFDr5GBr9lqJkTYbR2o0ud6zVFMvit58NPMw/YlOs6RtmXiB+dK2CPykvXEk+8TPcEEu3PX1vZruYqAjiXpko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hpcPZvs1; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hpcPZvs1" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 6E8241A1708; Tue, 18 Aug 2026 21:18:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3BE4C60355; Tue, 18 Aug 2026 21:18:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 02AD811C74F91; Tue, 18 Aug 2026 23:18:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1787087885; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=theVMtt8PGMNifoEo4OeVx2CmK0+t/UoylVVlPA5U7s=; b=hpcPZvs1wT5asHWfE7NqfxY2FicBHbT5zaclfpIlW15CuM3aQyp8hzxgPTQgBJUBnApLJq 87jiAJRVeZVEm85/wyk+fm/TFKPhhsCc5Cgiz+IdoRv49NYBekifD7Ur3UUnaTIiogD7Wg ny/KvyKi3Q76uyL3+FSXoRF5OIxRV1rVux/8fA9Ut67oaDmGtqr12IKuZbj10VKZklC84u S0RiAxf6d1ZgpxCFFrlwKbLT5+nwmWqpLv/VGxpEAWs4yi+UUSV6zYISYbtBItIb74x26A 6TdCJe06jrFLRsk6w+1PsrGRYe121Bf2Jx8QMhQ2m70SE8vuBEeH4XN2cGBhSw== Date: Tue, 18 Aug 2026 23:18:04 +0200 From: Alexandre Belloni To: Jisheng Zhang Cc: Frank Li , linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] i3c: dw: reduce do_daa time if there's no client Message-ID: <2026081821180483742fa7@mail.local> References: <20260814042015.25397-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=us-ascii Content-Disposition: inline In-Reply-To: <20260814042015.25397-1-jszhang@kernel.org> X-Last-TLS-Session-Version: TLSv1.3 Hi Jisheng, On 14/08/2026 12:20:15+0800, Jisheng Zhang wrote: > dw_i3c_master_daa() derives the number of newly assigned dynamic > addresses from cmd->rx_len, the ISR sets it to the number of address > slots ENTDAA left unassigned. It starts out as zero, which already > means "every address was assigned", so a timed out transfer leaves > that value in place and it gets used as a result. > > If there's no client connected, the addr assign cmd times out, then > the driver calls i3c_master_add_i3c_dev_locked() to add devices that > are not there, each costing about 1s, thus adds non necessary boot > time up to (maxdev * 1)s. > > Start from maxdevs instead: no address is assigned before ENTDAA runs, > and make newdevs as 0 if the existing rx_len >= maxdevs. > > Signed-off-by: Jisheng Zhang > --- > > since v1: > - use another method to remove the non-necessary calling of > i3c_master_add_i3c_dev_locked() if there's no client > - update commit msg > > drivers/i3c/master/dw-i3c-master.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > You'd have to rebase this one on i3c/next as it doesn't apply cleanly anymore. > diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c > index 1053cfb05c05..883b542c7bfc 100644 > --- a/drivers/i3c/master/dw-i3c-master.c > +++ b/drivers/i3c/master/dw-i3c-master.c > @@ -876,6 +876,7 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m) > goto rpm_out; > } > cmd = &xfer->cmds[0]; > + cmd->rx_len = master->maxdevs; > cmd->cmd_hi = COMMAND_PORT_TRANSFER_ARG; > cmd->cmd_lo = COMMAND_PORT_DEV_COUNT(master->maxdevs - pos) | > COMMAND_PORT_DEV_INDEX(pos) | > @@ -888,7 +889,10 @@ static int dw_i3c_master_daa(struct i3c_master_controller *m) > if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) > dw_i3c_master_dequeue_xfer(master, xfer); > > - newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0); > + if (cmd->rx_len >= master->maxdevs) > + newdevs = 0; > + else > + newdevs = GENMASK(master->maxdevs - cmd->rx_len - 1, 0); > newdevs &= ~olddevs; > > for (pos = 0; pos < master->maxdevs; pos++) { > -- > 2.51.0 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com