]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
PCI: Add has_mem64 for struct host_bridge
authorYinghai Lu <yinghai@kernel.org>
Thu, 8 Oct 2015 21:38:32 +0000 (14:38 -0700)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Mon, 19 Oct 2015 20:41:13 +0000 (13:41 -0700)
Add has_mem64 for struct host_bridge, on root bus that does not support
mmio64 above 4g, will not set that.

We will use that info next two following patches:
1. Don't treat non-pref mmio64 as pref mmio, so will not put
   it under bridge's pref range when rescan the devices
2. will keep pref mmio64 and pref mmio32 under bridge pref bar.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Orabug: 21826746

Signed-off-by: Khalid Aziz <khalid.aziz@oracle.com>
(cherry picked from commit a60c5ffaf17466433caac32fea9c45576ecdf5c4)

drivers/pci/probe.c
include/linux/pci.h

index 502ac894ec762a497356ae7a9b3468531cdc986d..7058e55396024ac39f4edbc93c19b28cc290828c 100644 (file)
@@ -2013,6 +2013,13 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
                } else
                        bus_addr[0] = '\0';
                dev_info(&b->dev, "root bus resource %pR%s\n", res, bus_addr);
+
+               if (resource_type(res) == IORESOURCE_MEM) {
+                       if ((res->end - offset) > 0xffffffff)
+                               bridge->has_mem64 = 1;
+                       if ((res->start - offset) > 0xffffffff)
+                               res->flags |= IORESOURCE_MEM_64;
+               }
        }
 
        down_write(&pci_bus_sem);
index 52d8a9060ee8c3b6fe99cd6d7948f7cfa3410626..5bce728c74d0c0a13bb151f8949effa4c6f96537 100644 (file)
@@ -408,6 +408,7 @@ struct pci_host_bridge {
        void (*release_fn)(struct pci_host_bridge *);
        void *release_data;
        unsigned int ignore_reset_delay:1;      /* for entire hierarchy */
+       unsigned int has_mem64:1;
 };
 
 #define        to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev)