Skip to contentSkip to conversation

PCI / ACPI: Do not request control of ASPM if the BIOS has disabled it

PATCH In review Rafael J. Wysocki 4 participants 5 messages May 24, 2012 – Aug 15, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI / ACPI: Do not request control of ASPM if the BIOS has disabled it

From: Rafael J. Wysocki <[email protected]>

We want to report that the kernel supports ASPM to the BIOS even if the BIOS signals us that it doesn't. So, we need the flags to include (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) before calling acpi_pci_osc_support(root, flags) in acpi_pci_root_add() (unless there's a command line telling us that ASPM is not to be supported).

However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly.

---

-stable material, I think.

Thanks,
Rafael

---
 drivers/acpi/pci_root.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/acpi/pci_root.c +4 -0
Index: linux/drivers/acpi/pci_root.c
===================================================================
@@ -574,6 +574,10 @@ static int __devinit acpi_pci_root_add(s
 	if (flags != base_flags)
 		acpi_pci_osc_support(root, flags);
 
+	if (!pcie_aspm_enabled())
+		flags &= ~(OSC_ACTIVE_STATE_PWR_SUPPORT |
+			OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
+
 	if (!pcie_ports_disabled
 	    && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
 		flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL
#1 lore raw
Quoted 7 lines · Rafael J. Wysocki

However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly.

Is there an example of an affected machine's DSDT?

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw

Hi Matthew,

Quoted 11 lines · Matthew Garrett
Quoted 7 lines · Rafael J. Wysocki

However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly.

Is there an example of an affected machine's DSDT?

Attached.

Jean

maintainer
#3 lore raw
In reply to Rafael J. Wysocki
Quoted 17 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

We want to report that the kernel supports ASPM to the BIOS even if the BIOS signals us that it doesn't. So, we need the flags to include (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) before calling acpi_pci_osc_support(root, flags) in acpi_pci_root_add() (unless there's a command line telling us that ASPM is not to be supported).

However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly.

Quoted 5 lines

---

-stable material, I think.

Len, since you've applied recent patches in this area, can you take care of this, too?

Quoted 19 lines
---
 drivers/acpi/pci_root.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux/drivers/acpi/pci_root.c
===================================================================

drivers/acpi/pci_root.c +4 -0
@@ -574,6 +574,10 @@ static int __devinit acpi_pci_root_add(s
        if (flags != base_flags)
                acpi_pci_osc_support(root, flags);
 
+       if (!pcie_aspm_enabled())
+               flags &= ~(OSC_ACTIVE_STATE_PWR_SUPPORT |
+                       OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
+
        if (!pcie_ports_disabled
            && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
                flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL
#4 lore raw
Quoted 18 lines · Bjorn Helgaas
Quoted 17 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

We want to report that the kernel supports ASPM to the BIOS even if the BIOS signals us that it doesn't. So, we need the flags to include (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) before calling acpi_pci_osc_support(root, flags) in acpi_pci_root_add() (unless there's a command line telling us that ASPM is not to be supported).

However, knowing that the BIOS doesn't support ASPM, we shouldn't request the control of it, so we should remove (OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT) from the flags before calling acpi_pci_osc_control_set() in those cases. Failing to do so causes the evaluation of _OSC for the PCI root bridge to return error codes on some systems where it should work correctly.

Quoted 8 lines
Quoted 5 lines

---

-stable material, I think.

Len, since you've applied recent patches in this area, can you take care of this, too?

No, please don't.

I'd discussed that with Matthew and we concluded that it would break things sometimes. Please disregard it (and sorry for not saying that earlier).

Thanks,
Rafael

Quoted 21 lines
Quoted 19 lines
---
 drivers/acpi/pci_root.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux/drivers/acpi/pci_root.c
===================================================================

drivers/acpi/pci_root.c +4 -0
@@ -574,6 +574,10 @@ static int __devinit acpi_pci_root_add(s
        if (flags != base_flags)
                acpi_pci_osc_support(root, flags);
 
+       if (!pcie_aspm_enabled())
+               flags &= ~(OSC_ACTIVE_STATE_PWR_SUPPORT |
+                       OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
+
        if (!pcie_ports_disabled
            && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
                flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL