[PATCH] ACPI: PCI: Avoid misleading _OSC messages for non-PCIe host bridges without _OSC

KONDO KAZUMA(近藤 和真) <[email protected]> Fri, 31 Jul 2026 09:09:06 +0000
Newsgroups org.kernel.vger.linux-acpi,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>
After commit 7d703df7f4f5 ("ACPI: bus: Split _OSC evaluation out of
acpi_run_osc()"), the _OSC evaluation path now returns AE_ERROR to
negotiate_os_control() instead of propagating AE_NOT_FOUND from
acpi_evaluate_object().

This has not caused any functional issues so far, but it produces
additional misleading messages for non-PCIe host bridges without _OSC on
some Intel servers:

    kernel: ACPI: Enabled 2 GPEs in block 00 to 7F
    kernel: ACPI: PCI Root Bridge [UNC0] (domain 0000 [bus fe])
    kernel: acpi PNP0A03:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM=
 Segments MSI EDR HPX-Type3]
  + kernel: acpi PNP0A03:00: _OSC: OS requested [PCIeHotplug SHPCHotplug PM=
E AER PCIeCapability LTR DPC]
  + kernel: acpi PNP0A03:00: _OSC: platform willing to grant [PCIeHotplug S=
HPCHotplug PME AER PCIeCapability LTR DPC]
  + kernel: acpi PNP0A03:00: _OSC: platform retains control of PCIe feature=
s (AE_ERROR)
    kernel: PCI host bridge to bus 0000:fe

Previously, negotiate_os_control() silently ignored AE_NOT_FOUND for
non-PCIe host bridges without _OSC, but after the above change, it no
longer does so.

As a result, negotiate_os_control() logs messages as if the OS had
negotiated with the platform via _OSC, even though the non-PCIe host
bridge has no _OSC method and no such negotiation actually occurs.

Skip _OSC negotiation for non-PCIe host bridges that do not define an
_OSC method before attempting to evaluate it.

Fixes: 7d703df7f4f5 ("ACPI: bus: Split _OSC evaluation out of acpi_run_osc(=
)")
Link: https://lore.kernel.org/linux-acpi/d0be949d-0e21-472e-a44b-cedb1dd869=
[email protected]/
Suggested-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Kazuma Kondo <[email protected]>
---
 drivers/acpi/pci_root.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 4c06c3ffd0cb..3a24d018436b 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -574,6 +574,12 @@ static void negotiate_os_control(struct acpi_pci_root =
*root, int *no_aspm)
 		return;
 	}
=20
+	/* _OSC is optional for PCI host bridges */
+	if (!is_pcie(root) && !acpi_has_method(handle, "_OSC")) {
+		dev_dbg(&device->dev, "_OSC: negotiation skipped (method not present for=
 non-PCIe host bridge)\n");
+		return;
+	}
+
 	support =3D calculate_support();
=20
 	decode_osc_support(root, "OS supports", support);
@@ -615,10 +621,6 @@ static void negotiate_os_control(struct acpi_pci_root =
*root, int *no_aspm)
 		 */
 		*no_aspm =3D 1;
=20
-		/* _OSC is optional for PCI host bridges */
-		if (status =3D=3D AE_NOT_FOUND && !is_pcie(root))
-			return;
-
 		if (control) {
 			decode_osc_control(root, "OS requested", requested);
 			decode_osc_control(root, "platform willing to grant", control);
--=20
2.49.0