On Sat, May 04, 2024 at 05:02:34PM +0200, Lukas Wunner wrote: > On Sat, May 04, 2024 at 12:56:30PM +0200, Nam Cao wrote: > > On Sat, May 04, 2024 at 11:51:54AM +0200, Lukas Wunner wrote: > > > Could you reproduce with pciehp instead of shpchp please? > > > > Same thing for pciehp below. I think the problem is because without > > pci_stop_and_remove_bus_device(), no one cleans up the device added in > > pci_scan_slot(). When another device get hot-added, pci_get_slot() wrongly > > thinks another device is already there, so the hot-plug fails. > > pciehp powers down the slot because you're returning a negative errno > from pciehp_configure_device(). Please return 0 instead if > pci_hp_add_bridge() fails. Thanks for the suggestion. This is applicable to shpchp as well. Best regards, Nam