Skip to content

Commit

Permalink
Merge tag 'pci-v4.6-fixes-3' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed May 10, 2016
2 parents 7ec02e3 + 9a2a5a6 commit c511462
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void pci_bus_add_device(struct pci_dev *dev)

dev->match_driver = true;
retval = device_attach(&dev->dev);
if (retval < 0) {
if (retval < 0 && retval != -EPROBE_DEFER) {
dev_warn(&dev->dev, "device attach failed (%d)\n", retval);
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
Expand Down Expand Up @@ -324,7 +324,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
}

list_for_each_entry(dev, &bus->devices, bus_list) {
BUG_ON(!dev->is_added);
/* Skip if device attach failed */
if (!dev->is_added)
continue;
child = dev->subordinate;
if (child)
pci_bus_add_devices(child);
Expand Down

0 comments on commit c511462

Please sign in to comment.