浏览代码

PCI: pciehp: Request control of native hotplug only if supported

Currently we request control of native PCIe hotplug unconditionally.
Native PCIe hotplug events are handled by the pciehp driver, and if it is
not enabled those events will be lost.

Request control of native PCIe hotplug only if the pciehp driver is
enabled, so we will actually handle native PCIe hotplug events.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Mika Westerberg 7 年之前
父节点
当前提交
408fec36a1
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/acpi/pci_root.c

+ 3 - 1
drivers/acpi/pci_root.c

@@ -472,9 +472,11 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)
 	}
 	}
 
 
 	control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL
 	control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL
-		| OSC_PCI_EXPRESS_NATIVE_HP_CONTROL
 		| OSC_PCI_EXPRESS_PME_CONTROL;
 		| OSC_PCI_EXPRESS_PME_CONTROL;
 
 
+	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
+		control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL;
+
 	if (pci_aer_available()) {
 	if (pci_aer_available()) {
 		if (aer_acpi_firmware_first())
 		if (aer_acpi_firmware_first())
 			dev_info(&device->dev,
 			dev_info(&device->dev,