diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-02-24 14:59:19 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-02-24 14:59:19 -0600 |
commit | da8eb3feea12b99d4d57a70a080dce1065bcfd09 (patch) | |
tree | 251515cffebb93a524428d1680d3371c76a8aec7 /drivers/pci | |
parent | 215fc27dd8a5f75d9b4cfbf7c07958db7887cdb3 (diff) | |
parent | 729e3a669d1b62e9876a671ac03ccba399a23b68 (diff) | |
download | linux-da8eb3feea12b99d4d57a70a080dce1065bcfd09.tar.bz2 |
Merge branch 'pci/resource'
- Decline requests to resize BARs if platform requires us to preserve
resource assignments (Ard Biesheuvel)
* pci/resource:
PCI: Decline to resize resources if boot config must be preserved
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/setup-res.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 43eda101fcf4..7f1acb3918d0 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -410,10 +410,16 @@ EXPORT_SYMBOL(pci_release_resource); int pci_resize_resource(struct pci_dev *dev, int resno, int size) { struct resource *res = dev->resource + resno; + struct pci_host_bridge *host; int old, ret; u32 sizes; u16 cmd; + /* Check if we must preserve the firmware's resource assignment */ + host = pci_find_host_bridge(dev->bus); + if (host->preserve_config) + return -ENOTSUPP; + /* Make sure the resource isn't assigned before resizing it. */ if (!(res->flags & IORESOURCE_UNSET)) return -EBUSY; |