]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Delay final fixups until resources are assigned
authorYinghai Lu <yinghai@kernel.org>
Tue, 7 May 2013 20:35:44 +0000 (14:35 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 7 May 2013 20:35:44 +0000 (14:35 -0600)
commitb0e3f1a2331b8151932454a33926f95b156cbb86
tree1e108b6df63cd51372246fdc2281cffaa548b6a1
parent439ba0d8636422d1da8f1b9553d564e26601f332
PCI: Delay final fixups until resources are assigned

Commit dd3857bb59 "PCI: Put pci_dev in device tree as early as possible"
moved final fixups from pci_bus_add_device() to pci_device_add().  But
pci_device_add() happens before resource assignment, so BARs may not be
valid yet.

Typical flow for hot-add:

    pciehp_configure_device
      pci_scan_slot
        pci_scan_single_device
          pci_device_add
            pci_fixup_device(pci_fixup_final, dev)  # previous location
      # resource assignment happens here
      pci_bus_add_devices
        pci_bus_add_device
          pci_fixup_device(pci_fixup_final, dev)    # new location

[bhelgaas: changelog, move fixups to pci_bus_add_device()]
Reference: https://lkml.kernel.org/r/20130415182614.GB9224@xanatos
Reported-by: David Bulkow <David.Bulkow@stratus.com>
Tested-by: David Bulkow <David.Bulkow@stratus.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.9+
drivers/pci/bus.c
drivers/pci/probe.c