summaryrefslogtreecommitdiffstats
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2016-03-01 10:58:04 -0600
committerBjorn Helgaas <bhelgaas@google.com>2016-03-08 12:14:31 -0600
commit2ea4adf75235c14c5a52a90eb3c282383f79a86b (patch)
tree80fb32a9161785ae87d2caf2c9821b4f01b6be9a /drivers/pci/setup-res.c
parent63e22924f5dc08badf9870c4a52ef4e7f7cbf218 (diff)
downloadop-kernel-dev-2ea4adf75235c14c5a52a90eb3c282383f79a86b.zip
op-kernel-dev-2ea4adf75235c14c5a52a90eb3c282383f79a86b.tar.gz
PCI: Don't assign or reassign immutable resources
IORESOURCE_PCI_FIXED means the resource can't be moved, so if it's set, don't bother trying to assign or reassign the resource. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 604011e..66c4d8f 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -276,6 +276,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
resource_size_t align, size;
int ret;
+ if (res->flags & IORESOURCE_PCI_FIXED)
+ return 0;
+
res->flags |= IORESOURCE_UNSET;
align = pci_resource_alignment(dev, res);
if (!align) {
@@ -321,6 +324,9 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
resource_size_t new_size;
int ret;
+ if (res->flags & IORESOURCE_PCI_FIXED)
+ return 0;
+
flags = res->flags;
res->flags |= IORESOURCE_UNSET;
if (!res->parent) {
OpenPOWER on IntegriCloud