linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] PCI: Clean up and fix is_hotplug_bridge usage
@ 2025-07-13 14:31 Lukas Wunner
  2025-07-13 14:31 ` [PATCH v2 1/5] PCI/ACPI: Fix runtime PM ref imbalance on Hot-Plug Capable ports Lukas Wunner
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Lukas Wunner @ 2025-07-13 14:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Laurent Bigonville, Mario Limonciello, Rafael J. Wysocki,
	Mika Westerberg, Alan Borzeszkowski, Gil Fine, Rene Sapiens,
	linux-pci

The original impetus of this series is to fix a runtime PM ref imbalance
on hot-removal of PCIe hotplug ports (patch [1/5]).

That is achieved by adding an is_pciehp flag to struct pci_dev.
The new flag is only set on PCIe Hot-Plug Capable ports, unlike the
existing is_hotplug_bridge flag, which is also set on ACPI slots and
Conventional PCI hotplug bridges (via quirk_hotplug_bridge()).

Patches [2/5] to [4/5] replace is_hotplug_bridge with is_pciehp in a
number of places for clarity and to fix some actual bugs.

Optional patch [5/5] follows a suggestion from Bjorn to set
host->native_pcie_hotplug up front based on pcie_ports_native.
That patch needs an ack from Rafael because it touches ACPI code.
Up to Bjorn whether it is a worthwhile improvement or not.

I'm open to suggestions for a different name than is_pciehp,
e.g. is_pciehp_bridge.

I've reviewed this a couple of times, but would appreciate further
reviewing and testing by others to raise the confidence.  Mika is
out of office until July 28, so I'm cc'ing thunderbolt developers
Alan, Gil and Rene.

I've got an additional patch to replace is_hotplug_bridge with is_pciehp
in quirk_thunderbolt_hotplug_msi() and tb_apple_add_links().  I intend
to submit it to Mika separately if/when this series is accepted.

Link to v1, which consisted only of a (problematic) variant of patch [1/5]:
https://lore.kernel.org/r/86c3bd52bda4552d63ffb48f8a30343167e85271.1750698221.git.lukas@wunner.de/

Lukas Wunner (5):
  PCI/ACPI: Fix runtime PM ref imbalance on Hot-Plug Capable ports
  PCI/portdrv: Use is_pciehp instead of is_hotplug_bridge
  PCI: pciehp: Use is_pciehp instead of is_hotplug_bridge
  PCI: Move is_pciehp check out of pciehp_is_native()
  PCI: Set native_pcie_hotplug up front based on pcie_ports_native

 drivers/acpi/pci_root.c          |  3 ++-
 drivers/pci/hotplug/pciehp_hpc.c |  2 +-
 drivers/pci/pci-acpi.c           | 10 +---------
 drivers/pci/pci.c                | 18 +++++++++++++-----
 drivers/pci/pcie/portdrv.c       |  4 ++--
 drivers/pci/probe.c              |  2 +-
 include/linux/pci.h              |  6 ++++++
 include/linux/pci_hotplug.h      |  3 ++-
 8 files changed, 28 insertions(+), 20 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-26 20:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-13 14:31 [PATCH v2 0/5] PCI: Clean up and fix is_hotplug_bridge usage Lukas Wunner
2025-07-13 14:31 ` [PATCH v2 1/5] PCI/ACPI: Fix runtime PM ref imbalance on Hot-Plug Capable ports Lukas Wunner
2025-07-26 20:50   ` Rafael J. Wysocki
2025-07-13 14:31 ` [PATCH v2 2/5] PCI/portdrv: Use is_pciehp instead of is_hotplug_bridge Lukas Wunner
2025-07-13 14:31 ` [PATCH v2 3/5] PCI: pciehp: " Lukas Wunner
2025-07-13 14:31 ` [PATCH v2 4/5] PCI: Move is_pciehp check out of pciehp_is_native() Lukas Wunner
2025-07-13 14:31 ` [PATCH v2 5/5] PCI: Set native_pcie_hotplug up front based on pcie_ports_native Lukas Wunner
2025-07-14 23:00   ` Sathyanarayanan Kuppuswamy
2025-07-14 23:50     ` Sathyanarayanan Kuppuswamy
2025-07-22 22:33       ` Bjorn Helgaas
2025-07-22 22:35 ` [PATCH v2 0/5] PCI: Clean up and fix is_hotplug_bridge usage Bjorn Helgaas
2025-07-25  8:19   ` Lukas Wunner
2025-07-25 19:33     ` Bjorn Helgaas
2025-07-26 20:52       ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).