aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-10 15:04:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-10 15:04:40 -0400
commitc5114626f33b62fa7595e57d87f33d9d1f8298a2 (patch)
tree9e6e746cc7ec599e44ffa33578af40236019b65f
parent7ec02e3bf45e0e7502db7f8d50c19abc1ebbab00 (diff)
parent9a2a5a638f8eb9c612a7a9af0afab93f506f6ba4 (diff)
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
-rw-r--r--drivers/pci/bus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 6c9f5467bc5f..dd7cdbee8029 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -294,7 +294,7 @@ void pci_bus_add_device(struct pci_dev *dev)
294 294
295 dev->match_driver = true; 295 dev->match_driver = true;
296 retval = device_attach(&dev->dev); 296 retval = device_attach(&dev->dev);
297 if (retval < 0) { 297 if (retval < 0 && retval != -EPROBE_DEFER) {
298 dev_warn(&dev->dev, "device attach failed (%d)\n", retval); 298 dev_warn(&dev->dev, "device attach failed (%d)\n", retval);
299 pci_proc_detach_device(dev); 299 pci_proc_detach_device(dev);
300 pci_remove_sysfs_dev_files(dev); 300 pci_remove_sysfs_dev_files(dev);
@@ -324,7 +324,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
324 } 324 }
325 325
326 list_for_each_entry(dev, &bus->devices, bus_list) { 326 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;
328 child = dev->subordinate; 330 child = dev->subordinate;
329 if (child) 331 if (child)
330 pci_bus_add_devices(child); 332 pci_bus_add_devices(child);