On Tue, Jun 16, 2020 at 12:13:23PM -0500, Ian May wrote: > Thanks for the quick reply! I like your solution and have confirmed it > solves the first deadlock we see between the Hotplug interrupt and AER > recovery. Thank you for the confirmation (and sorry for the delay). I'm cooking up a proper patch right now. One question regarding your patch [2/2]: If, instead of this patch, you change pci_bus_error_reset() to call "device_lock(bridge)" rather than "mutex_lock(&pci_slot_mutex)", do you still see deadlocks? Taking the pci_slot_mutex in pci_bus_error_reset() was actually the right thing to do because it holds the driver of the hotplug port in place. (The hotplug port above the bus being reset.) Without that, dereferencing slot->hotplug in pci_slot_reset() wouldn't be safe. My fear is that acquiring the device_lock() of the bridge leading to the bus being reset may cause other deadlocks, in particular in cascaded topologies such as Thunderbolt, which I suspect may be what you're dealing with. Thanks, Lukas