Commit 84c34829 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/hotplug'

- Enable pciehp by default if USB4 is enabled because USB4/Thunderbolt
  tunneling depends on native PCIe hotplug (Albert Zhou)

- Make sure pciehp binds only to Downstream Ports, not Upstream Ports
  (Rafael J. Wysocki)

- Remove unused get_mode1_ECC_cap callback in shpchp (Ian Cowan)

- Enable pciehp Command Completed Interrupt only if supported to reduce
  confusion when looking at lspci output (Pali Rohár)

* pci/hotplug:
  PCI: pciehp: Enable Command Completed Interrupt only if supported
  PCI: shpchp: Remove unused get_mode1_ECC_cap callback
  PCI: acpiphp: Avoid setting is_hotplug_bridge for PCIe Upstream Ports
  PCI/portdrv: Set PCIE_PORT_SERVICE_HP for Root and Downstream Ports only
  PCI: pciehp: Enable by default if USB4 enabled
parents 51ef4873 6d4671b5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6,11 +6,14 @@
menuconfig HOTPLUG_PCI
	bool "Support for PCI Hotplug"
	depends on PCI && SYSFS
	default y if USB4
	help
	  Say Y here if you have a motherboard with a PCI Hotplug controller.
	  This allows you to add and remove PCI cards while the machine is
	  powered up and running.

	  Thunderbolt/USB4 PCIe tunneling depends on native PCIe hotplug.

	  When in doubt, say N.

if HOTPLUG_PCI
+0 −3
Original line number Diff line number Diff line
@@ -58,9 +58,6 @@ shpchp:
  pciehp with commit 82a9e79ef132 ("PCI: pciehp: remove hpc_ops").  Clarify
  if there was a specific reason not to apply the same change to shpchp.

* The ->get_mode1_ECC_cap callback in shpchp_hpc_ops is never invoked.
  Why was it introduced?  Can it be removed?

* The hardirq handler shpc_isr() queues events on a workqueue.  It can be
  simplified by converting it to threaded IRQ handling.  Use pciehp as a
  template.
+8 −0
Original line number Diff line number Diff line
@@ -411,6 +411,14 @@ static void check_hotplug_bridge(struct acpiphp_slot *slot, struct pci_dev *dev)
	if (dev->is_hotplug_bridge)
		return;

	/*
	 * In the PCIe case, only Root Ports and Downstream Ports are capable of
	 * accommodating hotplug devices, so avoid marking Upstream Ports as
	 * "hotplug bridges".
	 */
	if (pci_is_pcie(dev) && pci_pcie_type(dev) == PCI_EXP_TYPE_UPSTREAM)
		return;

	list_for_each_entry(func, &slot->funcs, sibling) {
		if (PCI_FUNC(dev->devfn) == func->function) {
			dev->is_hotplug_bridge = 1;
+3 −1
Original line number Diff line number Diff line
@@ -811,7 +811,9 @@ static void pcie_enable_notification(struct controller *ctrl)
	else
		cmd |= PCI_EXP_SLTCTL_PDCE;
	if (!pciehp_poll_mode)
		cmd |= PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE;
		cmd |= PCI_EXP_SLTCTL_HPIE;
	if (!pciehp_poll_mode && !NO_CMD_CMPL(ctrl))
		cmd |= PCI_EXP_SLTCTL_CCIE;

	mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE |
		PCI_EXP_SLTCTL_PFDE |
+0 −1
Original line number Diff line number Diff line
@@ -311,7 +311,6 @@ struct hpc_ops {
	int (*get_latch_status)(struct slot *slot, u8 *status);
	int (*get_adapter_status)(struct slot *slot, u8 *status);
	int (*get_adapter_speed)(struct slot *slot, enum pci_bus_speed *speed);
	int (*get_mode1_ECC_cap)(struct slot *slot, u8 *mode);
	int (*get_prog_int)(struct slot *slot, u8 *prog_int);
	int (*query_power_fault)(struct slot *slot);
	void (*green_led_on)(struct slot *slot);
Loading