From nobody Mon Aug 17 03:13:42 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 4hNdFy5rX1z6nXrJ for ; Mon, 17 Aug 2026 03:13:42 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hNdFy4CV9z44lv for ; Mon, 17 Aug 2026 03:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786936422; 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=qloPNxnLSUwT+H7GNjOkn40FYhPWtVg6Gel5b25J7qk=; b=fek81j9ZMg2n+CP6RMAzRRDatAYWVXuLscUNDtHVY3Gn3ws40ZSUwXUBqNKpZ5z3CBmfDg KwUhYZOJmBYkDuJRCbQ/vattmAUfE3tvMvBOKvkQAIuuNSGWwlTMFyhktIHM0hYNs+JD5C Fl22dM3hNUZjs//h9jp9Bv6GHGA65UZJpRBY8+7V2Rv/WjcYXbdeICgNH+lxteIeMTQLdK uqHvPs00nrCgkkeHNSuRO7o2pmYl6pw39WnkPYnPE7ZOpsZ5r4Tbbvjg9w3zJ6UIOheEXS Ts0i4ktoCSVyMF4WpU5A3S1zkjuV+BowDfa69n37Iz4gjPeHDWUkGwOX4K7DNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786936422; a=rsa-sha256; cv=none; b=qQt6TuOsMXDEZhsmkHFLn9kbDNLmSQMVokEypdMnmP+KjbM2TuVXVvhJK+9f+b2m2bVPu5 yf6ZHnZZl9Sl9sC/9ECABOUDqOeorx5dZjnDnVpFKqoFi2IARG1/LeuorimdAgBkvzKoPq qUNrwyV0Mfc/pFUi5JigvPGowhMkI3HkWOLY2mz2ghe/DOHkiRuwv6XVZqXwCmfY62yXUA cUM61wdGdNd5dIK+yQH3nN1ajoac4j3s44Fa0m2pBIypo+G/u8NKZ+4l6gCWztrrWejQHZ GZ23BdtH5dLoun+TACAXjQBN3nGuP2EuqbPrjR35DOQWg30kpjtbdQqYJPZ0+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786936422; 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=qloPNxnLSUwT+H7GNjOkn40FYhPWtVg6Gel5b25J7qk=; b=HwGaBLBxcDJFxE2Th7N2czT0HUp7QMMqOmu2s/Pk9uIhGaO0pz4YET/crvxkSf3XniO3kH +asAqCDwZnDe0my85YPbGdgmBRfaqfC4Ucdhe3BPyLVCEhvEPzOIcJ5v5c+qaImEQYtYIw weE7aWojtBxr+4FIiQiY3Ob7woIO3NU3F4/xqvhiAUZO+qxY0ABez0perbC0+Wi7Gujfeb rosJYP/HmmXEuUvYbzE6DW5qOIoYpTPRAgI7xhULMIRRkqWdzIqFU1AlmN6XZJRgGSsv8m EAw9j32qnSpE7Iih97VirjzS3JFDeXTN4CVeF7maoLxJy3kpEbmv+dB+Anm83Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hNdFy1HTKzwrj for ; Mon, 17 Aug 2026 03:13:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21e66 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 17 Aug 2026 03:13:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: 37826269b41b - main - asmc: prefer MMIO backend over PIO when both are present List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: 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: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37826269b41b46c72264191d35b09baf24e055b9 Auto-Submitted: auto-generated Date: Mon, 17 Aug 2026 03:13:42 +0000 Message-Id: <6a827c66.21e66.2ba8dc1d@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=37826269b41b46c72264191d35b09baf24e055b9 commit 37826269b41b46c72264191d35b09baf24e055b9 Author: Abdelkader Boudih AuthorDate: 2026-08-17 03:12:00 +0000 Commit: Enji Cooper CommitDate: 2026-08-17 03:12:42 +0000 asmc: prefer MMIO backend over PIO when both are present T2, T1, and some pre-T1 Macs advertise a legacy PIO range in the SMC ACPI _CRS alongside a live MMIO window, but the silicon behind the PIO range is bogus. Try MMIO first, validate via LDKN >= 2, fall back to PIO if that fails or no MMIO resource is present. Drop "(T2)" from the backend message since MMIO isn't T2-exclusive. MFC: 1 week Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D58839 --- sys/dev/asmc/asmc.c | 18 ++++++++++-------- sys/dev/asmc/asmcmmio.c | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index d55c585419fb..80412b9c8daf 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -427,25 +427,22 @@ asmc_probe(device_t dev) } /* - * Try PIO first; fall back to MMIO for T2 Macs. + * Try MMIO first; the legacy PIO range can be claimable but dead. + * Fall back to PIO if MMIO probe fails or the resource is absent. */ static int asmc_try_probe(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); - sc->sc_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, - &sc->sc_rid_port, RF_ACTIVE); - if (sc->sc_ioport != NULL) - return (0); - sc->sc_rid_mem = 0; sc->sc_iomem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid_mem, RF_ACTIVE); if (sc->sc_iomem != NULL) { if (asmc_mmio_probe(dev) == 0) { sc->sc_is_mmio = true; - device_printf(dev, "using MMIO backend (T2)\n"); + if (bootverbose) + device_printf(dev, "using MMIO backend\n"); return (0); } bus_release_resource(dev, SYS_RES_MEMORY, @@ -453,7 +450,12 @@ asmc_try_probe(device_t dev) sc->sc_iomem = NULL; } - device_printf(dev, "unable to allocate IO port\n"); + sc->sc_ioport = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->sc_rid_port, RF_ACTIVE); + if (sc->sc_ioport != NULL) + return (0); + + device_printf(dev, "unable to allocate IO port or MMIO\n"); return (ENOMEM); } diff --git a/sys/dev/asmc/asmcmmio.c b/sys/dev/asmc/asmcmmio.c index 237e8ec4ed52..4981822c4723 100644 --- a/sys/dev/asmc/asmcmmio.c +++ b/sys/dev/asmc/asmcmmio.c @@ -292,7 +292,7 @@ asmc_mmio_probe(device_t dev) return (ENXIO); } - device_printf(dev, "MMIO: LDKN=%d, T2 SMC detected\n", ldkn); + device_printf(dev, "MMIO: LDKN=%d, MMIO-capable SMC detected\n", ldkn); sc->sc_is_t2 = 1; return (0);