OSDN Git Service

x86/PCI: Don't try to move IORESOURCE_PCI_FIXED resources
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 14 Apr 2014 21:30:09 +0000 (15:30 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 25 Apr 2014 17:09:04 +0000 (11:09 -0600)
Don't attempt to move resource marked IORESOURCE_PCI_FIXED, even if
pci_claim_resource() fails.  In some cases, these are legacy resources that
cannot be moved.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/x86/pci/i386.c

index db6b1ab..6db58d6 100644 (file)
@@ -271,11 +271,16 @@ static void pcibios_allocate_dev_resources(struct pci_dev *dev, int pass)
                                        "BAR %d: reserving %pr (d=%d, p=%d)\n",
                                        idx, r, disabled, pass);
                                if (pci_claim_resource(dev, idx) < 0) {
-                                       /* We'll assign a new address later */
-                                       pcibios_save_fw_addr(dev,
-                                                       idx, r->start);
-                                       r->end -= r->start;
-                                       r->start = 0;
+                                       if (r->flags & IORESOURCE_PCI_FIXED) {
+                                               dev_info(&dev->dev, "BAR %d %pR is immovable\n",
+                                                        idx, r);
+                                       } else {
+                                               /* We'll assign a new address later */
+                                               pcibios_save_fw_addr(dev,
+                                                               idx, r->start);
+                                               r->end -= r->start;
+                                               r->start = 0;
+                                       }
                                }
                        }
                }