On Mon, Sep 10, 2018 at 06:09:26PM +0200, Lukas Wunner wrote: > On Mon, Sep 10, 2018 at 08:56:42AM -0600, Keith Busch wrote: > > On Mon, Sep 10, 2018 at 06:20:33AM -0700, Lukas Wunner wrote: > > > The __pci_walk_bus() seems superfluous because the devices are also > > > marked disconnected when bringing down the slot as a result of the > > > synthesized PCI_EXP_SLTSTA_PDC event. > > > > Right, but we can't do that inline with the slot reset because of the > > circular locks that creates with the pci_bus_sem. We still want to > > fence off drivers for downstream devices from mucking with config space > > in a topology that is reported to be different than the one we're > > recoverying from. You can get undefined results that way. > > I don't quite follow. I meant that __pci_walk_bus() is unnecessary > because the pciehp_request() call indirectly triggers it. So the > devices are marked disconnected twice. Right, but pciehhp_request handling happens too late to fence off drivers bound to devices downstream this hotplug port. The disconnect setting needs to happen before pciehp's slot_reset returns.