From nobody Fri Oct 30 03:17:02 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 4jG5ql1WL7z6y6LR for ; Fri, 30 Oct 2026 03:17:07 +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 4jG5ql0wbTz4SCf for ; Fri, 30 Oct 2026 03:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793330227; 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=E+/3MG2OTF1tH9V8UC5CIdrJtnvAMVRSZCvd2uQ5hvc=; b=xKYSjv3G24CbdwfBXfGQLqytqEdDJKnCaY9/PYv2cQ+aYzdDXOoBXhCvgke3oiy7pm3w8v uGmnep0wF94zh9G+6lazlhEBsrIZ/2Pr6JUNpQbwFts3CVwlcX2JDt880If7qMLid48rwd kZdNuIx4n2jVNEnocRixWJg4lVoUSJPVSomdXMiXumFdw6oQVeaE1Iua5rUrVl/yXl6IlI kZvWuuwyBdKR987EFzIYoGNPkNgVDLH3HeymFbHwYkf7spnuq/4oJZMMCGXwF1HVwRCemm S/o0cICyMsgqD0EtStCYS7lgj1XPORb0zzImfqW7zm5Td6F7pnisrbjGFFq/pA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793330227; b=FdoKL4fwtLjzd8vwp1o3TXnGHkc4bU70hMQsfcCWuMzZowwLR3Z3LzlGnchtE1CO7nrVwg iWl7sUto3AcHRg1Wdx2t/RnJ7Gr57QRFOD+kRHOCLE6KdNtkIkDJB1ZP+iaRuXcd79BPte du77z5M7GXfxJKa8U6RsZQdSKtcJSeeNhIL9P19455N4To1pBkDocJt53foEbz+hO/peni 3ZwIe4NVgwOq2EmUJVgszYIQfFhrKTyYwWNqE/2f9GIEJYBFcymV4hlOqCS9ROSRLxjGql G/5ZAEmQmBVsRUQv1n/MYQVoTVrXp/OoM7ifImwzY8vasqu9abgH1TDzlxgWpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793330227; 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=E+/3MG2OTF1tH9V8UC5CIdrJtnvAMVRSZCvd2uQ5hvc=; b=dkVgus9d+hLCPFfWXT0D0gI6Ko9DsY71oetwl+r2UunfUjSe9fDvnpNG71LxC43TXXXZ1r 5im+7uRCEsmcg8Wcy3krx5CV1NdHSZQ8rv1TqD7sVodHU4HU+2Fe9eSu7XcxCI5zQUVaGn dG73XZLObgvjMEZoV6xRGoQEG912Sitkv6o0ywQERQ1Yt9fDZWdHih1Z8aHqdRY4FpoL1G gVk6wVokp0bxn/yKDR+v2koZJmaWriZo48H6rZs7seyJeQiLCb8VtOsYsDyeg3nafTs8NB 85FJtGlqkN0mqpbaf8xMRFmtbiYPzaO2H/RqkMKnV/hqXzfN2QNDdv1WjdaZJw== 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 4jG5ql0HHqz17Hl for ; Fri, 30 Oct 2026 03:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23a88 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 30 Oct 2026 03:17:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Denis Lemire From: Jaeyoon Choi Subject: git: 8721f68642c3 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 8721f68642c392afa0413eafa3cefde66d65b6eb Auto-Submitted: auto-generated Date: Fri, 30 Oct 2026 03:17:02 +0000 Message-Id: <6ae40c2e.23a88.4fcc4ccd@gitrepo.freebsd.org> The branch main has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=8721f68642c392afa0413eafa3cefde66d65b6eb commit 8721f68642c392afa0413eafa3cefde66d65b6eb Author: Denis Lemire AuthorDate: 2026-10-29 06:14:18 +0000 Commit: Jaeyoon Choi CommitDate: 2026-10-30 03:12:43 +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 --- 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;