linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Ignore spurious PCIe hotplug events
@ 2025-04-10 15:27 Lukas Wunner
  2025-04-10 15:27 ` [PATCH 1/2] PCI: pciehp: Ignore Presence Detect Changed caused by DPC Lukas Wunner
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Lukas Wunner @ 2025-04-10 15:27 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Sathyanarayanan Kuppuswamy, Keith Busch, Yicong Yang, linux-pci,
	Stuart Hayes, Mika Westerberg, Ilpo Jarvinen, Joel Mathew Thomas,
	Russ Weight, Matthew Gerlach, Yilun Xu, linux-fpga, Moshe Shemesh,
	Shay Drory, Saeed Mahameed, Alex Williamson

Trying to kill several birds with one stone here:

First of all, PCIe hotplug is deliberately ignoring link events occurring
as a side effect of Downstream Port Containment.  But it's not yet ignoring
Presence Detect Changed events.  These can happen if a hotplug bridge uses
in-band presence detect.  Reported by Keith Busch, patch [1/2] seeks to
fix it.

Second, PCIe hotplug is deliberately ignoring link events and Presence
Detect Changed events occurring as a side effect of a Secondary Bus Reset.
But that's no longer working properly since the introduction of bandwidth
control in v6.13-rc1.  Actually it never worked properly, but bandwidth
control is now mercilessly exposing the issue.  VFIO is thus broken,
it resets the device on passthrough.  Reported by Joel Mathew Thomas.

Third, link or presence events can not only occur as a side effect of DPC
or SBR, but also because of suspend to D3cold, a firmware update or FPGA
reconfiguration.  In particular, Altera engineers report that the link
goes down as a side effect of FPGA reconfiguration and the PCIe hotplug
driver responds by disabling slot power.  Obviously not what you'd want
while the FPGA is being reconfigured!

This leads me to believe that we need a generic mechanism to tell hotplug
drivers that spurious link changes are ongoing which need to be ignored.
Patch [2/2] introduces an API for it and the first user is SBR handling
in PCIe hotplug.  This fixes the issue exposed by bandwidth control.
It also aligns DPC and SBR handling in the PCIe hotplug driver such that
they use the same code path.

The API pci_hp_ignore_link_change() / pci_hp_unignore_link_change() is
initially not exported.  It can be once the first modular user shows up.

Although these are technically fixes, they're slightly intrusive, so it
would be good to let them simmer in linux-next for a while.  One option
would be to apply for v6.16 and let Greg & Sasha do the backporting.
Another would be to apply to the for-linus branch for v6.15 but wait
maybe 4 weeks before a pull request is sent.

Please review and test.  Thanks!

Lukas Wunner (2):
  PCI: pciehp: Ignore Presence Detect Changed caused by DPC
  PCI: pciehp: Ignore Link Down/Up caused by Secondary Bus Reset

 drivers/pci/hotplug/pci_hotplug_core.c | 69 ++++++++++++++++++++++++++++++
 drivers/pci/hotplug/pciehp.h           |  1 +
 drivers/pci/hotplug/pciehp_core.c      | 29 -------------
 drivers/pci/hotplug/pciehp_hpc.c       | 78 ++++++++++++++++++++++------------
 drivers/pci/pci.h                      |  3 ++
 include/linux/pci.h                    |  8 ++++
 6 files changed, 132 insertions(+), 56 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-04-18  1:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 15:27 [PATCH 0/2] Ignore spurious PCIe hotplug events Lukas Wunner
2025-04-10 15:27 ` [PATCH 1/2] PCI: pciehp: Ignore Presence Detect Changed caused by DPC Lukas Wunner
2025-04-11  2:34   ` Sathyanarayanan Kuppuswamy
2025-04-11  8:58     ` Lukas Wunner
2025-04-14 13:33   ` Ilpo Järvinen
2025-04-10 15:27 ` [PATCH 2/2] PCI: pciehp: Ignore Link Down/Up caused by Secondary Bus Reset Lukas Wunner
2025-04-11 22:28   ` Sathyanarayanan Kuppuswamy
2025-04-12  3:36     ` Lukas Wunner
2025-04-13 17:21       ` Sathyanarayanan Kuppuswamy
2025-04-13 17:22   ` Sathyanarayanan Kuppuswamy
2025-04-14 13:32   ` Ilpo Järvinen
2025-04-16  8:00   ` Ilpo Järvinen
2025-04-10 22:19 ` [PATCH 0/2] Ignore spurious PCIe hotplug events Bjorn Helgaas
2025-04-15 20:51 ` Keith Busch
2025-04-16 15:06   ` Lukas Wunner
2025-04-18  1:26     ` Keith Busch

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).