diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2018-05-23 18:40:23 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-06-02 01:18:28 -0400 |
commit | 1df81a6d6e01ff3f351c614c5bc35b49847e1dc5 (patch) | |
tree | da574d3095c83692bccf5ae669415ece176ea8a2 | |
parent | 82280f7af729125b89d47cb420cac0a761664b32 (diff) |
PCI: shpchp: Request SHPC control via _OSC when adding host bridge
The SHPC driver now must be builtin (it cannot be a module). If it is
present, request SHPC control immediately when adding the ACPI host bridge.
This is similar to how we handle native PCIe hotplug via pciehp.
Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
[bhelgaas: split to separate patch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/acpi/pci_root.c | 5 | ||||
-rw-r--r-- | drivers/pci/probe.c | 1 | ||||
-rw-r--r-- | include/linux/pci.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 032a578da5d4..d9b8407ce4e8 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -477,6 +477,9 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm) | |||
477 | if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)) | 477 | if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)) |
478 | control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL; | 478 | control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL; |
479 | 479 | ||
480 | if (IS_ENABLED(CONFIG_HOTPLUG_PCI_SHPC)) | ||
481 | control |= OSC_PCI_SHPC_NATIVE_HP_CONTROL; | ||
482 | |||
480 | if (pci_aer_available()) { | 483 | if (pci_aer_available()) { |
481 | if (aer_acpi_firmware_first()) | 484 | if (aer_acpi_firmware_first()) |
482 | dev_info(&device->dev, | 485 | dev_info(&device->dev, |
@@ -903,6 +906,8 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, | |||
903 | host_bridge = to_pci_host_bridge(bus->bridge); | 906 | host_bridge = to_pci_host_bridge(bus->bridge); |
904 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)) | 907 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)) |
905 | host_bridge->native_pcie_hotplug = 0; | 908 | host_bridge->native_pcie_hotplug = 0; |
909 | if (!(root->osc_control_set & OSC_PCI_SHPC_NATIVE_HP_CONTROL)) | ||
910 | host_bridge->native_shpc_hotplug = 0; | ||
906 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL)) | 911 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL)) |
907 | host_bridge->native_aer = 0; | 912 | host_bridge->native_aer = 0; |
908 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL)) | 913 | if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL)) |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index eba2b17d2d80..91712b2ee2c6 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -553,6 +553,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv) | |||
553 | */ | 553 | */ |
554 | bridge->native_aer = 1; | 554 | bridge->native_aer = 1; |
555 | bridge->native_pcie_hotplug = 1; | 555 | bridge->native_pcie_hotplug = 1; |
556 | bridge->native_shpc_hotplug = 1; | ||
556 | bridge->native_pme = 1; | 557 | bridge->native_pme = 1; |
557 | 558 | ||
558 | return bridge; | 559 | return bridge; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 3f009003706a..a4968cdb5f33 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -475,6 +475,7 @@ struct pci_host_bridge { | |||
475 | unsigned int no_ext_tags:1; /* No Extended Tags */ | 475 | unsigned int no_ext_tags:1; /* No Extended Tags */ |
476 | unsigned int native_aer:1; /* OS may use PCIe AER */ | 476 | unsigned int native_aer:1; /* OS may use PCIe AER */ |
477 | unsigned int native_pcie_hotplug:1; /* OS may use PCIe hotplug */ | 477 | unsigned int native_pcie_hotplug:1; /* OS may use PCIe hotplug */ |
478 | unsigned int native_shpc_hotplug:1; /* OS may use SHPC hotplug */ | ||
478 | unsigned int native_pme:1; /* OS may use PCIe PME */ | 479 | unsigned int native_pme:1; /* OS may use PCIe PME */ |
479 | /* Resource alignment requirements */ | 480 | /* Resource alignment requirements */ |
480 | resource_size_t (*align_resource)(struct pci_dev *dev, | 481 | resource_size_t (*align_resource)(struct pci_dev *dev, |