Skip to content

Commit c511462

Browse files
committed
Merge tag 'pci-v4.6-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: "Since v4.5, we've WARNed during resume if a PCI device, including a Thunderbolt device, was added while we were suspended. A change we merged for v4.6-rc1 turned that warning into a system hang. These enumeration patches from Lukas Wunner fix this issue: - Fix BUG on device attach failure - Do not treat EPROBE_DEFER as device attach failure" * tag 'pci-v4.6-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Do not treat EPROBE_DEFER as device attach failure PCI: Fix BUG on device attach failure
2 parents 7ec02e3 + 9a2a5a6 commit c511462

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/pci/bus.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void pci_bus_add_device(struct pci_dev *dev)
294294

295295
dev->match_driver = true;
296296
retval = device_attach(&dev->dev);
297-
if (retval < 0) {
297+
if (retval < 0 && retval != -EPROBE_DEFER) {
298298
dev_warn(&dev->dev, "device attach failed (%d)\n", retval);
299299
pci_proc_detach_device(dev);
300300
pci_remove_sysfs_dev_files(dev);
@@ -324,7 +324,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
324324
}
325325

326326
list_for_each_entry(dev, &bus->devices, bus_list) {
327-
BUG_ON(!dev->is_added);
327+
/* Skip if device attach failed */
328+
if (!dev->is_added)
329+
continue;
328330
child = dev->subordinate;
329331
if (child)
330332
pci_bus_add_devices(child);

0 commit comments

Comments
 (0)