[v2,1/2] PCI/ACPI: Move _OSC test for native services to top

Message ID 1540483292-24049-2-git-send-email-asierra@xes-inc.com
State New
Delegated to: Bjorn Helgaas
Headers show
Series
  • Improve _OSC control request granularity
Related show

Commit Message

Aaron Sierra Oct. 25, 2018, 4:01 p.m.
Move the simple test for when PCIe native services are disabled
closer to the top, prior to where things get more complicated.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
 drivers/acpi/pci_root.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Patch

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 707aafc..eb9f14e 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -441,6 +441,12 @@  static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
 		return;
 	}
 
+	if (pcie_ports_disabled) {
+		dev_info(&device->dev,
+			 "PCIe port services disabled; not requesting _OSC control\n");
+		return;
+	}
+
 	/*
 	 * All supported architectures that use ACPI have support for
 	 * PCI domains, so we indicate this in _OSC support capabilities.
@@ -468,11 +474,6 @@  static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
 		return;
 	}
 
-	if (pcie_ports_disabled) {
-		dev_info(&device->dev, "PCIe port services disabled; not requesting _OSC control\n");
-		return;
-	}
-
 	if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
 		decode_osc_support(root, "not requesting OS control; OS requires",
 				   ACPI_PCIE_REQ_SUPPORT);