From nobody Thu Nov 13 16:28:17 2025 X-Original-To: dev-commits-src-branches@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 4d6m0f2Fpjz6H66P; Thu, 13 Nov 2025 16:28:18 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d6m0f1DwRz3gjl; Thu, 13 Nov 2025 16:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763051298; 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=BZqMubf93UrAxFgdRsGNuJoX+fUzVOWUH0y3rw/ivNM=; b=lmtLVzw7PHQfKtKkX+/TZvT7KlTl65rKNhFs+KhCUr3GTx6RwQ+WX4Xf1AY9VlLK3Pg75m NJrS03cT53QDRoMRnBhRbmxN/TzmnYRX7QfcBPOQev68tUspMh0zo5SlsC46ZS0fszsnO3 jPg9aX0aFeUaPSmJdI5fQHhqcP94AyVEmu93SyS0Fa3ILT5bfOMzHE//w8k0TS2M1IaSGB yuwGcBSS3uBqYJ5xXqwsVZo05L8gcxPRuafxk+IjKPxxKF9IniPGAD+FDjJX+R2nfmKu+r 8cmtR0hJtbnHg5XMcHu16JraVNfuH9RMTmqH4/+W1wDfWrn7gMU+MUA/6OHvFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1763051298; 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=BZqMubf93UrAxFgdRsGNuJoX+fUzVOWUH0y3rw/ivNM=; b=l0BvkibOajiTVo+zZO4MoYhcIshVRm3JEqSQfaJ96qkXiB3PGssFATU3TOZpkyW2a+6XDG e8V9X04BoT71yDqdWcub8HyrKBMWVl6rrJobqE+1J9b503RZOC+ixq7ank1C5w7lpObNUl f4RDBxX35iZ0/E8jVqJhu2jfernNLKf2nAaxAd09CUhK7xxs5f+/pCEtTQGLtaFxZjjyam fMh5dFb3qZf5f3itZJpMlY02b5IfyhKdJf4xsu7C6wrLDDamiF5eB3HV3rpPwkmQWGP4if OPrRmHlEqerCkEsVB3oohB8OWCLbQ/TRMKg/j749krcNclY09Ygo/IAbW3Fa1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1763051298; a=rsa-sha256; cv=none; b=cbTBAmd2P3JbNnp1vm/EUByxfeuXgj8LyNSGiEBQjEORAWxjKA1/9zBH388SycY9KehScA 4OXyXdPKxlxXG9mPQBmrERRQpH/AEfDcUm6NYjEe4tf3v8wRPCHNOSt/2QGmS2l7UqNUZO 55JwkGnX5W/+vAzivqo9StgliMjzWeJfFab3YKw9a9ZlyxS4edL6xK9R1zKTulvuOYgvPo GYxtu0MJGgRDRvzS+R0jroNtTwnIEPHBtt1P5uwcEP5/ijkgwNDG5x5ETufjGlksN6RVdr eo2sSgaYnp49HSjSf/5wuhIaGZg81Lj2ADX7y03bdwPBKkuIU97UqH428LMMow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4d6m0f0XBWzCL3; Thu, 13 Nov 2025 16:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5ADGSHUs053513; Thu, 13 Nov 2025 16:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5ADGSHN8053510; Thu, 13 Nov 2025 16:28:17 GMT (envelope-from git) Date: Thu, 13 Nov 2025 16:28:17 GMT Message-Id: <202511131628.5ADGSHN8053510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: fc22812b6685 - stable/15 - mmc_fdt: handle broken-cd property List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: fc22812b66851523de41be79c9a0c1395d7a76c9 Auto-Submitted: auto-generated The branch stable/15 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fc22812b66851523de41be79c9a0c1395d7a76c9 commit fc22812b66851523de41be79c9a0c1395d7a76c9 Author: Mitchell Horne AuthorDate: 2025-11-05 14:37:36 +0000 Commit: Mitchell Horne CommitDate: 2025-11-13 16:24:48 +0000 mmc_fdt: handle broken-cd property The documented properties [1] for card-detection are one of: - cd-gpios - non-removable - broken-cd In cd_setup() we handle the first two, but not the latter, resulting in a silently undetected card on an affected system. To work around this, force cd_disabled when broken-cd is specified, so that the card detect helper function gets to run. A more complete solution would implement some kind of polling mechanism to detect the card's presence or removal. Some variants of the Allwinner D1, such as the Lichee Rv, specify this property in the mmc0 device node. [1] sys/contrib/device-tree/Bindings/mmc/mmc-controller.yaml Reported by: Haowu Ge Tested by: Haowu Ge Reviewed by: imp, manu, mmel MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D53546 (cherry picked from commit 768ee6d454821cc63247cb4ffe526c5a06accff0) --- sys/dev/mmc/mmc_fdt_helpers.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/mmc/mmc_fdt_helpers.c b/sys/dev/mmc/mmc_fdt_helpers.c index aed85dab55f4..980785464a00 100644 --- a/sys/dev/mmc/mmc_fdt_helpers.c +++ b/sys/dev/mmc/mmc_fdt_helpers.c @@ -159,6 +159,17 @@ cd_setup(struct mmc_helper *helper, phandle_t node) return; } + /* + * If the device has no card-detection, treat it as non-removable. + * This could be improved by polling for detection. + */ + if (helper->props & MMC_PROP_BROKEN_CD) { + helper->cd_disabled = true; + if (bootverbose) + device_printf(dev, "Broken card-detect\n"); + return; + } + /* * If there is no cd-gpios property, then presumably the hardware * PRESENT_STATE register and interrupts will reflect card state