On Tue, Dec 15, 2020 at 01:56:21PM +0100, Hinko Kocevar wrote: > I noticed the change you are pointing out when trying to propose a patch. > > It made me curious on why the pcie_portdrv_slot_reset() is not invoked. > > After sprinkling a couple of printk()'s around the pcie_do_recovery() and > pcie_portdrv_err_handler's I can observe that the pcie_portdrv_slot_reset() > is never called from pcie_do_recovery() due to status returned by > reset_subordinates() (actually aer_root_reset() from pcie/aer.c) being > PCI_ERS_RESULT_RECOVERED. > > I reckon, in order to invoke the pcie_portdrv_slot_reset(), the > aer_root_reset() should have returned PCI_ERS_RESULT_NEED_RESET. > > As soon as I plug the calls to pci_restore_state() and pci_save_state() into > the pcie_portdrv_err_resume() the bus and devices are operational again. It appears some sequences in the aer handling are out of sync with at least a few driver's expectations. The .slot_reset callback is for when 'PCI slot has been reset' according the the code comments, so we should be calling this after the reset to notify driver's of downstream devices that event occured. I'll mess with it a bit and see if we can get everyone aligned.