On Fri, Oct 21, 2016 at 05:37:14PM +0200, Lukas Wunner wrote: > On Tue, Sep 27, 2016 at 04:23:32PM -0400, Keith Busch wrote: > > --- a/drivers/pci/hotplug/pciehp_pci.c > > +++ b/drivers/pci/hotplug/pciehp_pci.c > > @@ -109,6 +109,8 @@ int pciehp_unconfigure_device(struct slot *p_slot) > > break; > > } > > } > > + if (!presence) > > + dev->is_removed = 1; > > pci_stop_and_remove_bus_device(dev); > > /* > > * Ensure that no new Requests will be generated from > > Sorry for the delay Keith, I finally got around to test v3 of your > series with hot-removed Thunderbolt devices on Apple Macs. > > I've found that the above isn't sufficient, it's necessary to also > set the is_removed bit on any child devices. E.g. on my system > when an Apple Gigabit Ethernet adapter is plugged in, the topology > looks like this: Thanks for the catch. Your proposal looks good to me. I'll send a new revision incorporating something like this that the dpc driver can also use. > With your patch above, the is_removed bit is only set on 0000:09:00.0 > but not on its children. Consequently the "tg3" driver tries to > access the hot-removed Broadcom 57762 Ethernet chip as before, > causing a soft lockup. Is that something that can be fixed in the tg3 driver? I don't think drivers can rely on this patch to fense off their unintended access since we can't stop tg3 from accesses a removed device before 'is_removed' is set. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html