diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2022-12-10 17:36:34 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-12-10 17:36:34 +0100 |
commit | 8961fc4f8c78f876c4b7278c5d5fb47f0e2ba1be (patch) | |
tree | 793b96decc4323c00a360bb8ce2412088accf303 /drivers/pci | |
parent | Merge branch 'pci/portdrv' (diff) | |
parent | x86/PCI: Use pr_info() when possible (diff) | |
download | linux-8961fc4f8c78f876c4b7278c5d5fb47f0e2ba1be.tar.xz linux-8961fc4f8c78f876c4b7278c5d5fb47f0e2ba1be.zip |
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.c | 4 |
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); |