On Mon, Apr 09, 2018 at 04:04:40PM -0600, Keith Busch wrote: > AER error handling walks the PCI topology below a root port, saving > pointers of the pci_dev structs affected by the error along the way. > > At the same time, the pcie hotplug driver could be freeing those very > same structures, causing the AER driver to reference freed memory. > > This series fixes this by synchroniziing the aer driver with the pci > hotplug driver during. The final patch is the one that ultimately provides > the locking by having AER lock the same pci lock rescan/remove mutex as > the pciehp driver. The first three patches are prepping to make it safe > for the aer bottom half handler to hold that lock. > > Keith Busch (4): > PCI/AER: Remove unused parameters > PCI/AER: Replace struct pcie_device with pci_dev > PCI/AER: Reference count aer structures > PCI/AER: Lock pci topology when scanning errors > > drivers/pci/pcie/aer/aerdrv.c | 28 +++++++++++++++++++++------- > drivers/pci/pcie/aer/aerdrv.h | 9 +++------ > drivers/pci/pcie/aer/aerdrv_core.c | 38 +++++++++++++++++--------------------- > 3 files changed, 41 insertions(+), 34 deletions(-) I applied the first two to pci/aer for v4.18, thanks! I think the last two might need some rework to adapt after Oza's patches.