]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/setup-res.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / pci / setup-res.c
index f5ff0d3ba620791d61291338b7190e874a55ab09..cb4ced3560e9117109934d27f4dd5f18c38f03b0 100644 (file)
@@ -33,11 +33,22 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
        u32 new, check, mask;
        int reg;
 
-       /* Ignore resources for unimplemented BARs and unused resource slots
-          for 64 bit BARs. */
+       /*
+        * Ignore resources for unimplemented BARs and unused resource slots
+        * for 64 bit BARs.
+        */
        if (!res->flags)
                return;
 
+       /*
+        * Ignore non-moveable resources.  This might be legacy resources for
+        * which no functional BAR register exists or another important
+        * system resource we should better not move around in system address
+        * space.
+        */
+       if (res->flags & IORESOURCE_PCI_FIXED)
+               return;
+
        pcibios_resource_to_bus(dev, &region, res);
 
        pr_debug("  got res [%llx:%llx] bus [%lx:%lx] flags %lx for "
@@ -121,7 +132,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
 {
        struct pci_bus *bus = dev->bus;
        struct resource *res = dev->resource + resno;
-       unsigned long size, min, align;
+       resource_size_t size, min, align;
        int ret;
 
        size = res->end - res->start + 1;
@@ -209,9 +220,13 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
        for (i = 0; i < PCI_NUM_RESOURCES; i++) {
                struct resource *r;
                struct resource_list *list, *tmp;
-               unsigned long r_align;
+               resource_size_t r_align;
 
                r = &dev->resource[i];
+
+               if (r->flags & IORESOURCE_PCI_FIXED)
+                       continue;
+
                r_align = r->end - r->start;
                
                if (!(r->flags) || r->parent)
@@ -225,7 +240,7 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
                }
                r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
                for (list = head; ; list = list->next) {
-                       unsigned long align = 0;
+                       resource_size_t align = 0;
                        struct resource_list *ln = list->next;
                        int idx;