From nobody Fri Jul 31 21:37:15 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 4hBfYD6ykrz6ncG3 for ; Fri, 31 Jul 2026 21:37:20 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hBfYD6Hh4z3fWv for ; Fri, 31 Jul 2026 21:37:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785533840; 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=WwBLvKBn9ZhuF3d0dg3I23zxyFDlADnIwLtLzGXsCjY=; b=Oma2XEyEQydJZXVE53tnSlVbNqqVhtXxy+k/05jQYA2QxSI3+UQ2vU8myRohuqjifaoK0p z8G0zUQoMHCQ4SS4QNVzehmttEREQiP72gy65UjzQmT3ZYyloTHA187tX6Cmo/u+PEMFWu ZQZQgA0eh5WGjWWduveQsdmwk7jwwFW3FFxxhQBM+Xh7Rd7Ppcev6akrXQyjI5BOujnM4J Afj9k/F3QUuUlCVreiMW+otREGUPbKdv17kM5660onQ4ha6ql7H7Ay8FuJTqiJsMoFyUCL UJRcHu/FcNEcBCSGz1LTJltsyRVQoW8uwE5vy7YUnAatwzWZNslXiTtL0KBKpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785533840; a=rsa-sha256; cv=none; b=droiTanauDxOKC5syuB9crjb3RyG3GVyGz6oz5jxCTfvWtdqnxwK/6qYWhswwOwICtXOLm BXljp9poelOzOyWzktgDHDgtue6L47by12AsSBPIJvDSJzK8PMtSKAkroi4ARo8GP3EyMu KF9Z9OMwRMpM3kO2eu/LJGGA1a51+G/LcU4TWfh8rmMFBXQBmXjkvoCwi1Ns+RZnCWj7ze ZWmwy8oTdjjDbjaq0Xxt0WeCGkS7P8XGuhhI7blBcvFQU5ImJMmwRotoa42hhcqFCfn0O3 J7roI8m/+bYIvLl+QZO2fdiSIOCaWvHcvxsC53n9f+IPcW4yNx5KYJnF3kgl6g== 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=1785533840; 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=WwBLvKBn9ZhuF3d0dg3I23zxyFDlADnIwLtLzGXsCjY=; b=if91Wrmu1U/56lKuNxEbcGxBfhpLQKJi1TIZZ0Csn7i+4aJluKytXyKnqMAjP3MF6oyB50 OWcrWhibOBY/+vnjg8rOzTcqRNgc3NzK5KqqBbbBs9o0V7VSn7p/DL1Z9paKLgav9K7Fpr PRnxoV25AnB48ph+gtCwrNoIviryVDJe6TQXumz+XyYnBtcqpBLstzVO32scPCdo7Bl9YG j0zrnpFn8WphLTlAuBCkU6V2rDiDF+vq/hwO/agqG2ZK+5IPNLbl2LvnQlpFD1hLeoBTl1 0OItccgGjigmmilRpbov8++hRNtMk45D6JHyrWVA4/0Hew7tDI0k/slG4OLFww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBfYD4hWWz1t1 for ; Fri, 31 Jul 2026 21:37:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37997 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 21:37:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 21bc31ce2e4a - main - acpi: parse resources of not-present devices that are kept enabled 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21bc31ce2e4a7106ec352c9e30fc6d948b881653 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 21:37:15 +0000 Message-Id: <6a6d158b.37997.644cb464@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=21bc31ce2e4a7106ec352c9e30fc6d948b881653 commit 21bc31ce2e4a7106ec352c9e30fc6d948b881653 Author: Abdelkader Boudih AuthorDate: 2026-07-31 21:25:52 +0000 Commit: Adrian Chadd CommitDate: 2026-07-31 21:26:08 +0000 acpi: parse resources of not-present devices that are kept enabled acpi_probe_child() keeps PCI link devices, the RTC, and docking stations enabled even when _STA reports them not present, but skipped acpi_parse_resources() for them. With an empty resource list, resource-based hint matching (BUS_HINT_DEVICE_UNIT) cannot wire such a device to its hinted unit, and the hinted ISA device is then created as a duplicate. Modern AMI firmware reports the PNP0B00 RTC as not present while handing timekeeping to the ACPI Time-and-Alarm device. Reviewed by: adrian, jhb Differential Revision: https://reviews.freebsd.org/D58047 --- sys/dev/acpica/acpi.c | 59 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 93451667a2b2..5469df01fd35 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2474,6 +2474,34 @@ acpi_probe_order(ACPI_HANDLE handle, int *order) *order = 4; } +/* + * Some devices must remain enabled even when _STA (ACPI 6.5, section 6.3.7) + * reports them as not present: + * + * - PCI link devices (_HID PNP0C0F, section 6.1.5), which sometimes report + * "present" but not "functional" (i.e. if disabled). + * - The RTC (_HID PNP0B00), which is needed for CMOS register space unless + * the FADT indicates it is not present (checked in the RTC probe routine). + * - Docking stations, which have a _DCK method (section 6.5.2), since the + * system may be undocked at boot. + */ +static bool +acpi_always_present(ACPI_HANDLE handle) +{ + ACPI_HANDLE h; + + if (acpi_MatchHid(handle, "PNP0C0F")) + return (true); + + if (acpi_MatchHid(handle, "PNP0B00")) + return (true); + + if (ACPI_SUCCESS(AcpiGetHandle(handle, "_DCK", &h))) + return (true); + + return (false); +} + /* * Evaluate a child device and determine whether we might attach a device to * it. @@ -2485,7 +2513,6 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) struct acpi_device *ad; struct acpi_prw_data prw; ACPI_OBJECT_TYPE type; - ACPI_HANDLE h; device_t bus, child; char *handle_str; int d, order; @@ -2549,30 +2576,14 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) * leave it disabled (so that we have a device_t attached to * the handle, but we don't probe it). * - * XXX PCI link devices sometimes report "present" but not - * "functional" (i.e. if disabled). Go ahead and probe them - * anyway since we may enable them later. + * Devices that are kept enabled still have their resources + * parsed below so that resource-based hint matching + * (BUS_HINT_DEVICE_UNIT) can wire their unit numbers; + * otherwise a hinted ISA device can duplicate the ACPI + * device. */ - if (type == ACPI_TYPE_DEVICE && !acpi_DeviceIsPresent(child)) { - /* Never disable PCI link devices. */ - if (acpi_MatchHid(handle, "PNP0C0F")) - break; - - /* - * RTC Device should be enabled for CMOS register space - * unless FADT indicate it is not present. - * (checked in RTC probe routine.) - */ - if (acpi_MatchHid(handle, "PNP0B00")) - break; - - /* - * Docking stations should remain enabled since the system - * may be undocked at boot. - */ - if (ACPI_SUCCESS(AcpiGetHandle(handle, "_DCK", &h))) - break; - + if (type == ACPI_TYPE_DEVICE && !acpi_DeviceIsPresent(child) && + !acpi_always_present(handle)) { device_disable(child); break; }