summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2022-12-10 10:36:34 -0600
committerBjorn Helgaas <bhelgaas@google.com>2022-12-10 10:36:34 -0600
commit8961fc4f8c78f876c4b7278c5d5fb47f0e2ba1be (patch)
tree793b96decc4323c00a360bb8ce2412088accf303 /drivers/pci
parent9303050181bcea67cfda2bd74e3508a333e2e23a (diff)
parentd91482bb212b36354b0e46d7a5c0adae807e7a12 (diff)
downloadlinux-8961fc4f8c78f876c4b7278c5d5fb47f0e2ba1be.tar.bz2
Merge branch 'pci/resource'
- Remove EfiMemoryMappedIO regions from the E820 map to allow PCI core to allocate BARs from them. The only purpose of EfiMemoryMappedIO is to tell the OS to map things needed by EFI runtime services, so it's often used for PCI host bridge apertures. If we can't allocate from those apertures, we can't hot-add devices (Bjorn Helgaas) * pci/resource: x86/PCI: Use pr_info() when possible x86/PCI: Fix log message typo x86/PCI: Tidy E820 removal messages PCI: Skip allocate_resource() if too little space available efi/x86: Remove EfiMemoryMappedIO from E820 map
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/bus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 3cef835b375f..83ae838ceb5f 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -197,6 +197,10 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res,
max = avail.end;
+ /* Don't bother if available space isn't large enough */
+ if (size > max - min_used + 1)
+ continue;
+
/* Ok, try it out.. */
ret = allocate_resource(r, res, size, min_used, max,
align, alignf, alignf_data);