From nobody Sat Sep 05 23:32:28 2026 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 4hcqPT3YGlz6rJrL for ; Sat, 05 Sep 2026 23:32:29 +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 4hcqPT0sH8z47vC for ; Sat, 05 Sep 2026 23:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788651149; 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=Xs6c9l98OKtYybhdwz93IP1JxQnIyA79WL/xjdlo//Q=; b=ealoplLqhNc4LAbQbOzlF21jw0zUnyrGKr0NvQck5nydmFOeDRyPwsoKAq+VnQoIy1xN6R 6DOILDL2c1wheeKL9JoSka7yV4Lzts8ObBFU9nnr6+NGqN49RpJ8U6iHlmaG3S2xj7QXz0 ih4IstUDbS1YvjbpgqudETLeIzOwEpvh2EKc8bkYXp6BQs5MPOsp1OeuRasM4z+rTwqoAg eLAALbdl7tgdrJNgSqKga8YlJrLmbrpdNQ2/IEwAwHxYnSldVZTCB0mwz+J77aw0f7rklA HWWEqqVbRhsJzbWHQDdr8yO+1mb8vPVrIHdiwHuHlmfbY0+C+nprlG05yjweyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788651149; a=rsa-sha256; cv=none; b=GUhgOjfAaoDRKRHbvGCPVZjLqDuvO8Rt3ZZb2kl1pBG/nQqcB3Pvpd3Htf0Ov8ir7VYAf3 PCvod0nV9zl8eGmZ4q529+uUU0aqPpcmJt2hdavBAdGtmojHaTGAVWXtV2z0HTYwlPUPPe 2VSaMfp3TM/TWVPQ9Cc3ayMOvsCwQ3ut04ykUYZ5xyWZB6HPjNAZctTxy3VEZrwNMTTRqx 2U/x7Re8YbrjSc82XUA3JcIjM75l5NaRmMTUbQTYs9/9O6xDXBAoaowWVlmQ4o5LzZHNwT dCNjh5DaSlxT3VeYwRIHrONkDUy2WFINpXBtflaX+reZwkFMYcPgMypOf+EUsA== 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=1788651149; 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=Xs6c9l98OKtYybhdwz93IP1JxQnIyA79WL/xjdlo//Q=; b=Rh/6dSiRcAeCsbgjEEljVK2l59axE0KrSg6Z9lmf0xz/TOwdLIWna+sK4YNEzQSJDCg587 SkGNBUihmcTWmj7d//aZz2gpx5P7C/QU6p4lHABP6XYA1d9bGVBM06UW88qStlYz38I1mT 8rAlOHpyNqYRRpORRI3+lY1LiT14rBjaYYoHZZMhMNmSnfNe4H1rCx01uw+yMtAnUSZ8B/ IL7yQo8ylddhNOKWVQWkQU/w+kbdWFvzIh73zd0xig4nPqmEJPcfuwwZIhNHlY5ecOgSP3 AuXUX6Z21clJB6zsE4GJ4DmTknu7exlgpXvEilrvknRDmUtm+JiRkJFXMpZFrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hcqPS70Bgz15r0 for ; Sat, 05 Sep 2026 23:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2488a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 05 Sep 2026 23:32:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: 7a0f01a84d62 - stable/14 - asmc: prefer MMIO backend over PIO when both are present 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 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a0f01a84d62e05d6f68c58ee504647068403586 Auto-Submitted: auto-generated Date: Sat, 05 Sep 2026 23:32:28 +0000 Message-Id: <6a9ca68c.2488a.3b8529d9@gitrepo.freebsd.org> The branch stable/14 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=7a0f01a84d62e05d6f68c58ee504647068403586 commit 7a0f01a84d62e05d6f68c58ee504647068403586 Author: Abdelkader Boudih AuthorDate: 2026-08-17 03:12:00 +0000 Commit: Enji Cooper CommitDate: 2026-09-05 23:31:47 +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 (cherry picked from commit 37826269b41b46c72264191d35b09baf24e055b9) --- 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);