diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-26 11:25:58 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-27 10:43:32 -0700 |
commit | f44116ae881868ab72274df1eff48fdbde9898af (patch) | |
tree | c5a1428c5c83ca19975ad9fa73db3ea831c32500 /drivers/pci/quirks.c | |
parent | d19cb803a2ff85d1b64b9628e1aec2aa76a9260b (diff) | |
download | lwn-f44116ae881868ab72274df1eff48fdbde9898af.tar.gz lwn-f44116ae881868ab72274df1eff48fdbde9898af.zip |
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/quirks.c')
0 files changed, 0 insertions, 0 deletions