On Wed, Apr 16, 2025 at 05:06:23PM +0200, Lukas Wunner wrote: > On Tue, Apr 15, 2025 at 02:51:42PM -0600, Keith Busch wrote: > > On Thu, Apr 10, 2025 at 05:27:10PM +0200, Lukas Wunner wrote: > > > 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. > > > > There are switches that let you > > toggle downstream connections to change what's attached and it causes a > > DPC event, swapping out the downstream device at the same time. So this > > change has the pci driver resume with the wrong device if you happen to > > be in such a situation. I don't have such switches anymore > > What's the error type causing the DPC event? Surprise Down? > > Since commit 2ae8fbbe1cd4 ("PCI/DPC: Ignore Surprise Down error on hot > removal"), which went into v6.9, the DPC driver handles Surprise Down > silently and it tells the hotplug driver *not* to ignore the hotplug > event. It does that by unconditionally clearing the PCI_DPC_RECOVERED > flag at the end of dpc_handle_surprise_removal(). > > Hence in the situation you're describing, the hotplug driver should > always bring down the slot and bring it back up with the new device. I think you're right, thank you for the pointers.