commit 7063b1e2145bca02bbdd807d3c2ca97748deb73a Author: Steven Newbury Date: Sat Apr 14 13:25:14 2012 +0100 Add a new PCI resource flag to force a conflict for a given resource, use this new flag with a quirk to trigger reallocation over >4G. diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a24d473..820dc1e 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -32,6 +32,20 @@ #include "pci.h" /* + * Force reallocation >4G (if available) for intel GMA + */ +static void __devinit quirk_intel_gma_realloc(struct pci_dev * dev) +{ + if (sizeof(resource_size_t) == 8) { + struct resource *r = &dev->resource [2]; + if (r->start < 0x100000000) { + r->flags |= IORESOURCE_MEM_FORCEREALLOC; + } + } +} +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a02, quirk_intel_gma_realloc); + +/* * Decoding should be disabled for a PCI device during BAR sizing to avoid * conflict. But doing so may cause problems on host bridge and perhaps other * key system devices. For devices that need to have mmio decoding always-on, diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index ea96ced..aad43c3 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -116,6 +116,8 @@ int pci_claim_resource(struct pci_dev *dev, int resource) conflict = request_resource_conflict(root, res); if (conflict) { + if (res->flags & IORESOURCE_MEM_FORCEREALLOC) + res->flags &= ~IORESOURCE_MEM_FORCEREALLOC; dev_info(&dev->dev, "address space collision: %pR conflicts with %s %pR\n", res, conflict->name, conflict); diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 8f8433d..a4159f6 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -89,6 +89,7 @@ struct resource { #define IORESOURCE_MEM_32BIT (3<<3) #define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */ #define IORESOURCE_MEM_EXPANSIONROM (1<<6) +#define IORESOURCE_MEM_FORCEREALLOC (1<<7) /* Force rellocation of this resource */ /* PnP I/O specific bits (IORESOURCE_BITS) */ #define IORESOURCE_IO_16BIT_ADDR (1<<0) diff --git a/kernel/resource.c b/kernel/resource.c index 9cbfc40..770d713 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -156,6 +156,8 @@ static struct resource * __request_resource(struct resource *root, struct resour resource_size_t end = new->end; struct resource *tmp, **p; + if (new->flags & IORESOURCE_MEM_FORCEREALLOC) + return root; if (end < start) return root; if (start < root->start)