From nobody Thu Nov 05 14:51:55 2026 X-Original-To: dev-commits-src-main@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 4jL4yh131Qz707Dx for ; Thu, 05 Nov 2026 14:51:56 +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 4jL4yg52KJz3G3T for ; Thu, 05 Nov 2026 14:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793890315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vz+9vJ8DvZXmA69fvY+3FalGMTplOqDFEdnSpBjmbjE=; b=asiJREwwWX0W5AlKJTayip2nqhafIUv0vLmxrnb/fG0nisw2GvMwQs8gJRxYsyyTtXyTdx B4RdyStnBWRbTikS40KcGUKeQu7FjXtHOBYer3NlGTgZq/7SXTUsQR1khpj8sy5CPAkfRf wRcJAH9HQQvA00aVlOzuN0ITdIzrUcAIE0rnG6CiAbByfIPyKpe5SunF9aWZ0nTgBfmV1e VDigiRCOOkpqo415rb2WYVSoV7p03o5BrrLiXBY/8EPurs5/QS1/VvIUL9Xgpc+QfRG3rM ff8MTSn6KemfDZoskVTuf2hQRkUD3ZMjNyCIcZNCTnVWjntfacZdTiEielxUzQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793890315; b=eYQLCAgwiYEdpPddBE+sxXMqycuxqx0EfcSqrOlYvez6SMPpMTiQCdLJEEcdWhdtxT/yOf wX1Jv9gNhYzh7eq+kWV3PqLgD2xiGYjee6zB/LKYKTBFq40Xkqh+WDuuEbE2oWNlXFxSDC F5B+MhD+48c9ECHDg1j4gvYf5Y21YWqPxhOmNkdJCpgh3N0gUyU1HT2EaG7Hduj5AIHCpm eeXwECgxA1dbVcLJtGf7AvbBsZeF/ceYN47jZTK2uNc//pMZK5W4Z4QuGdnWdawB1oR0Jf cDEp8wfzxqVQxuqIiWeqiYJAMhFVZG16L8fcTqxICbVmqr7l9tOXTjFwpgis4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793890315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vz+9vJ8DvZXmA69fvY+3FalGMTplOqDFEdnSpBjmbjE=; b=bl1HHiQSjgLbJSC9yHx0nrDMLydVeqSctMb6HciLIhYKJCQReSVPiZL9hPPS19tkRLHmt8 9xV9xMHTmFhK/sZ17q4v/3vW4qZn5h4eivLX0dM3ZD6UeO5JNlPPP2llE0KCxLU8/oXWDp ZEKaj2k0T79DD9Bj4pFykDnzzJ+z1JHFaiu/0Uo3VCllaf+s2++JURqgN9usaWV+n+qMqn bfAtvMcEr6dS5tax8pQJaSwftlUBKid37u9iG4ra4EQ3CjfzaaL++MsB/TZX7e0U1P3owo W03b7r6Cu4Z0nIy1nXwql0Mqbx8Wj6TocacY7tJbms7p2yrscwp9bEVK0YUANA== 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 4jL4yg4NX1zvmK for ; Thu, 05 Nov 2026 14:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2114b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 05 Nov 2026 14:51:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1af3197bbe35 - main - mmccam: Wait for the power to settle when probing a card List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch 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: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1af3197bbe356e87e0b446177e820f18d6d7c277 Auto-Submitted: auto-generated Date: Thu, 05 Nov 2026 14:51:55 +0000 Message-Id: <6aec980b.2114b.7f4b8fb7@gitrepo.freebsd.org> The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1af3197bbe356e87e0b446177e820f18d6d7c277 commit 1af3197bbe356e87e0b446177e820f18d6d7c277 Author: Emmanuel Vadot AuthorDate: 2026-10-22 06:33:55 +0000 Commit: Emmanuel Vadot CommitDate: 2026-11-05 14:51:36 +0000 mmccam: Wait for the power to settle when probing a card The mmc(4) stack waits after powering up a card: mmc_power_up() waits 1 ms after the supplies are on and 2 ms after the clock is running, before the first command is sent. The MMCCAM probe had no such wait: it went from the power_up request to the power_on request to CMD0 without any delay. Some devices do not answer the first commands if they are sent too early and then never enumerate, with no error. On a RockPro64 the Broadcom SDIO Wi-Fi (BCM4359) was not detected on any of 8 boots without a delay. It was detected on 8 out of 8 with the same waits as mmc_power_up() added to the probe. Add the same two waits, once the power_up request and once the power_on request are done. This replaces the delay that was in mmc_fdt_set_power(), which was a fixed 10 ms for FDT hosts only; the waits of the legacy stack are enough and apply to every MMCCAM host. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D61077 --- sys/cam/mmc/mmc_xpt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 5c26ee30d36a..704d4ed8f3b0 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -842,12 +842,26 @@ mmcprobe_done(struct cam_periph *periph, union ccb *done_ccb) case PROBE_RESET_BUS: { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_RESET_BUS\n")); + /* + * Let the supplies settle after the card is powered up before + * the clock is started, like mmc_power_up() does in the mmc(4) + * stack. This is a busy wait because it runs from the xpt done + * thread, where sleeping is not allowed. + */ + DELAY(1000); PROBE_SET_ACTION(softc, PROBE_SET_ID_FREQ); break; } case PROBE_SET_ID_FREQ: { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("done with PROBE_SET_ID_FREQ\n")); + /* + * The card needs at least 74 clock cycles, or 1 ms, with the + * clock running before it can take the first command. Wait for + * the same time as mmc_power_up() in the mmc(4) stack. Some + * cards (e.g. Broadcom SDIO Wi-Fi) are not detected without it. + */ + DELAY(2000); PROBE_SET_ACTION(softc, PROBE_SET_CS); break; }