From nobody Tue Aug 25 14:32:22 2026 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 1FFB4346A07 for ; Fri, 14 Aug 2026 04:39:52 +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=1786682394; cv=none; b=VHjNHCPI6ZwqeZurGBqDUJG3yRIGnw4/zRWlIOkwk293y2A5UZld1f42Q3kZDbD/VFXqY6e8GwAdRXKmGZgH1gvVyBli2GPYe9xKzxouVHXtW4hsf7RTQro54AAMoLi4w9NjcfAQTtZ49B3K/QyOWr/xcsNYPBVvU569XE5DZ64= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786682394; c=relaxed/simple; bh=NjLQqOyhmsmIThxFIdr3LDe+fBnsYhkpBiWQJy9iLCw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rV6Xz3eztgFT9dmm8goDjIATHHvnfu5tI3MLaz9pkjZwEO/nK9r+Ft6l1TKnsLuSjN5dFpPKshfKCI49EqSMbd7Jz6eQA19dTpaZ0w2JCtgVg0pF1QiduTjNWaTTtJY302MyLYgK9rV9RoGCLfqpng+M24N1Tme2OcJwMV3qub4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BJgXksi2; 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="BJgXksi2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CB5A1F000E9; Fri, 14 Aug 2026 04:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786682392; bh=WA52jFGCTiWvUw93Fa+qfHMHLvnniBEtjegFKYacuuc=; h=From:To:Cc:Subject:Date; b=BJgXksi2XZJ52xB0GTCl2TDwgj1u1GYWGreRSSh0+fBSFRyS4AzpZDQ1/a5WyXvKB Pwu4kcJaOWTvrE9SB0pmXV34I+u4RlvVtN+GX8VPWGYR/u04EDGmP41v2JcmG+449w 85knuOstYmiBLH393d617IQ6UGV9Xpm/CKxEZBsBuHh94h/+nhstsUZpQ1LeXQmURz LLCyKlMhKzgw4uJexlgiR4HgbFVd1rm7eFflZnxhxailZJ3e3QNXbLgGKbXjrnYAmf RxW2tHlgl4xx5tLiGqzy5VHCDpqPbN5W/ULbKAhry2tsNvsIkTlAeiQbsWyCxrQ7BG 7Upxy1ak+eOtg== From: Jisheng Zhang To: Alexandre Belloni , Frank Li Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] i3c: dw: reduce do_daa time if there's no client Date: Fri, 14 Aug 2026 12:20:15 +0800 Message-ID: <20260814042015.25397-1-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 >=3D maxdevs. Signed-off-by: Jisheng Zhang Reviewed-by: Frank Li --- 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(-) 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_controll= er *m) goto rpm_out; } cmd =3D &xfer->cmds[0]; + cmd->rx_len =3D master->maxdevs; cmd->cmd_hi =3D COMMAND_PORT_TRANSFER_ARG; cmd->cmd_lo =3D 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_control= ler *m) if (!wait_for_completion_timeout(&xfer->comp, XFER_TIMEOUT)) dw_i3c_master_dequeue_xfer(master, xfer); =20 - newdevs =3D GENMASK(master->maxdevs - cmd->rx_len - 1, 0); + if (cmd->rx_len >=3D master->maxdevs) + newdevs =3D 0; + else + newdevs =3D GENMASK(master->maxdevs - cmd->rx_len - 1, 0); newdevs &=3D ~olddevs; =20 for (pos =3D 0; pos < master->maxdevs; pos++) { --=20 2.51.0