From nobody Mon Nov 02 02:28:49 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jHwck1tFSz6yS23 for ; Mon, 02 Nov 2026 02:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jHwck168qz4NG5 for ; Mon, 02 Nov 2026 02:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793586534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l8RBH+Z/1FP+xzbnzDYdh0Tk+gxD6qa+itne+rlL/AU=; b=XlFWeOJW+01LSNsRpcbGN/dQHdCUgDyQuFConE4AqsFf+fFJr4+f7TnBPc1HdZGoymljQ/ QAkC9J8NJBSeIGq1qVHO9UlevglJaId+2cRcM+eRvUG1fCZDacc6D70rQM3xqDriwY+7f5 525rAr8WZla8IXOw43Wrin7kk4y/P9BRRV+vymCsPFUG8cL06ucnLKGkP0saG2k6nEZsro 26IXRG7nG6GJmLqmQxcPr627VtSMYZiYWevuVGFjGXZsFXE9mX9h4rb8ep7HyaFuyy347T aVaIEg6haNJavznoCjqgPmw5UXjZSY9ZGBO/t7oAnDUlCkpnxfSDpZW92ElCuA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793586534; b=jLycIupLbxwrmZnNsjdANysBA7ft7ho9bOaOHvrPtQRdWZiyEJmXcqoS/R6giHDrZl4AEL LwJBeo7cX8Blacgo1mMKo5CzznA5gHRBPOZ+LmGCZ58v36hK7VhNgyzeThg1OYj5iRzPhr ybkqt/WteFAEh+8qfKBhXHI5KWrLFq4W6NHYBypdk7uBPOP9W+ifEeLjcfxOF0hCFCJPvu ar4DEydSTbh3tgpgmlE+VJJyzvG/xOU0nwI/h55wpq8KtLNSOVPjpJMDfBqmXPLJGBnZZY NAt/y/yhr+ITK+pOwopNO+Q92KGmPqr5PndiBEbNzKSmx8Yu8rAww/03q/netQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793586534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l8RBH+Z/1FP+xzbnzDYdh0Tk+gxD6qa+itne+rlL/AU=; b=eH8WmJuff9MqkAl4RzCTmpnctTMQH/Cmrrf5idcxwomgyaMNnc9HBEPXP+8SXi5wSOngfT ehm5b74s7JzF0iFPpJOj9WXLM9kLf0QQMAclKO4sBDEWamMgOd78Zv4w3A7l6kNzsNTSut L4Hw4WV+re4ycQo4n1wasGEn9WviGiiGMuAtzFoioUvog2sslHu/ItRIJwm+mwGjoVf+oJ Qc7JNnbwIhBjUhCm08YJhqHnUs3kaeZXJZt6rQWv56h+4g58L5GKZEZ5n15j90KCTJrf4D TcRv8qn1vI76kUnu16cXJHsUGR8KE0lFs3kPczkbO4ke+eWsxd9hM3vIoMTXcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jHwck0l0xzQBL for ; Mon, 02 Nov 2026 02:28:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33ef3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 02 Nov 2026 02:28:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Denis Lemire From: Jaeyoon Choi Subject: git: 9462353bf065 - stable/15 - ufshci: fix the WLUN peripheral lookup timeout List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jaeyoon X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 9462353bf06584126ff85f50f958b61da51bdcf4 Auto-Submitted: auto-generated Date: Mon, 02 Nov 2026 02:28:49 +0000 Message-Id: <6ae7f561.33ef3.d33be1f@gitrepo.freebsd.org> The branch stable/15 has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=9462353bf06584126ff85f50f958b61da51bdcf4 commit 9462353bf06584126ff85f50f958b61da51bdcf4 Author: Denis Lemire AuthorDate: 2026-10-29 06:14:18 +0000 Commit: Jaeyoon Choi CommitDate: 2026-11-02 02:24:53 +0000 ufshci: fix the WLUN peripheral lookup timeout The timeout in ufshci_sim_find_periph() is uint64_t, making the comparison of timeout - ticks with zero always false. If the requested peripheral does not become available, the lookup can wait indefinitely. Use an sbintime_t deadline based on sbinuptime() and mstosbt(), and compare the current uptime directly with the deadline. Preserve the successful lookup path and existing timeout cleanup. On an HP 15-fd0118ca with Intel N150 and Samsung UFS 3.1 storage, a kernel built from stable/15 revision 84aa3cb3204d with this change logged the missing-WLUN timeout, attached da0 and mounted root in two boot trials. Signed-off-by: Denis Lemire Reviewed by: jaeyoon Fixes: 31407551c3d4 ("ufshci: Add a check for WLUN during driver initialization") MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/2520 (cherry picked from commit 8721f68642c392afa0413eafa3cefde66d65b6eb) --- sys/dev/ufshci/ufshci_sim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/ufshci/ufshci_sim.c b/sys/dev/ufshci/ufshci_sim.c index d9ea84961879..dc5198ae6f35 100644 --- a/sys/dev/ufshci/ufshci_sim.c +++ b/sys/dev/ufshci/ufshci_sim.c @@ -452,7 +452,7 @@ ufshci_sim_find_periph(struct ufshci_controller *ctrlr, uint8_t wlun) struct cam_path *path; struct cam_periph *periph = NULL; uint64_t scsi_lun; - uint64_t timeout; + sbintime_t timeout; /* The reset path can get here before the SIM is attached. */ if (ctrlr->ufshci_sim == NULL) @@ -466,7 +466,7 @@ ufshci_sim_find_periph(struct ufshci_controller *ctrlr, uint8_t wlun) } /* Wait for the perip device to be found */ - timeout = ticks + MSEC_2_TICKS(ctrlr->device_init_timeout_in_ms); + timeout = sbinuptime() + mstosbt(ctrlr->device_init_timeout_in_ms); while (1) { xpt_path_lock(path); @@ -478,7 +478,7 @@ ufshci_sim_find_periph(struct ufshci_controller *ctrlr, uint8_t wlun) if (periph) break; - if (timeout - ticks < 0) { + if (sbinuptime() >= timeout) { ufshci_printf(ctrlr, "Failed to find the Well known LUN(0x%x)\n", wlun); break;