Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1df81a6d authored by Mika Westerberg's avatar Mika Westerberg Committed by Bjorn Helgaas
Browse files

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: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
[bhelgaas: split to separate patch]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 82280f7a
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -477,6 +477,9 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)
	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
		control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL;
		control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL;


	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_SHPC))
		control |= OSC_PCI_SHPC_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,
@@ -903,6 +906,8 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
	host_bridge = to_pci_host_bridge(bus->bridge);
	host_bridge = to_pci_host_bridge(bus->bridge);
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL))
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL))
		host_bridge->native_pcie_hotplug = 0;
		host_bridge->native_pcie_hotplug = 0;
	if (!(root->osc_control_set & OSC_PCI_SHPC_NATIVE_HP_CONTROL))
		host_bridge->native_shpc_hotplug = 0;
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL))
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL))
		host_bridge->native_aer = 0;
		host_bridge->native_aer = 0;
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL))
	if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL))
+1 −0
Original line number Original line Diff line number Diff line
@@ -553,6 +553,7 @@ struct pci_host_bridge *pci_alloc_host_bridge(size_t priv)
	 */
	 */
	bridge->native_aer = 1;
	bridge->native_aer = 1;
	bridge->native_pcie_hotplug = 1;
	bridge->native_pcie_hotplug = 1;
	bridge->native_shpc_hotplug = 1;
	bridge->native_pme = 1;
	bridge->native_pme = 1;


	return bridge;
	return bridge;
+1 −0
Original line number Original line Diff line number Diff line
@@ -475,6 +475,7 @@ struct pci_host_bridge {
	unsigned int	no_ext_tags:1;		/* No Extended Tags */
	unsigned int	no_ext_tags:1;		/* No Extended Tags */
	unsigned int	native_aer:1;		/* OS may use PCIe AER */
	unsigned int	native_aer:1;		/* OS may use PCIe AER */
	unsigned int	native_pcie_hotplug:1;	/* OS may use PCIe hotplug */
	unsigned int	native_pcie_hotplug:1;	/* OS may use PCIe hotplug */
	unsigned int	native_shpc_hotplug:1;	/* OS may use SHPC hotplug */
	unsigned int	native_pme:1;		/* OS may use PCIe PME */
	unsigned int	native_pme:1;		/* OS may use PCIe PME */
	/* Resource alignment requirements */
	/* Resource alignment requirements */
	resource_size_t (*align_resource)(struct pci_dev *dev,
	resource_size_t (*align_resource)(struct pci_dev *dev,