summaryrefslogtreecommitdiff
path: root/drivers/pci/rom.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-02-26 18:25:58 (GMT)
committerBjorn Helgaas <bhelgaas@google.com>2014-02-27 17:43:32 (GMT)
commitf44116ae881868ab72274df1eff48fdbde9898af (patch)
treec5a1428c5c83ca19975ad9fa73db3ea831c32500 /drivers/pci/rom.c
parentd19cb803a2ff85d1b64b9628e1aec2aa76a9260b (diff)
downloadlinux-f44116ae881868ab72274df1eff48fdbde9898af.tar.xz
PCI: Remove pci_find_parent_resource() use for allocation
If the resource hasn't been allocated yet, pci_find_parent_resource() is documented as returning the region "where it should be allocated from." This is impossible in general because there may be several candidates: a prefetchable BAR can be put in either a prefetchable or non-prefetchable window, a transparent bridge may have overlapping positively- and subtractively-decoded windows, and a root bus may have several windows of the same type. Allocation should be done by pci_bus_alloc_resource(), which iterates through all bus resources and looks for the best match, e.g., one with the desired prefetchability attributes, and falls back to less-desired possibilities. The only valid use of pci_find_parent_resource() is to find the parent of an already-allocated resource so we can claim it via request_resource(), and all we need for that is a bus region of the correct type that contains the resource. Note that like 8c8def26bfaa ("PCI: allow matching of prefetchable resources to non-prefetchable windows"), this depends on pci_bus_for_each_resource() iterating through positively-decoded regions before subtractively-decoded ones. We prefer not to return a subtractively-decoded region because requesting from it will likely conflict with the overlapping positively- decoded window (see Launchpad report below). Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/424142 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pci/rom.c')
0 files changed, 0 insertions, 0 deletions