Message ID | 4F89B5E8.3040906@snewbury.org.uk |
---|---|
State | Rejected, archived |
Headers | show |
On Sat, Apr 14, 2012 at 10:37 AM, Steven Newbury <steve@snewbury.org.uk> wrote: > I've created a new quirk utilising an extra PCI resource flag to force > reallocation of the resource. It's the first approach I've had any > success at. It does work. Only "Intel Page Flush" now gets allocated > @0xe0000000! Maybe we can be more aggressive with pci=pref_bar to reassign all pref mem. Please check attached patch. Yinghai
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 15/04/12 04:21, Yinghai Lu wrote: > On Sat, Apr 14, 2012 at 10:37 AM, Steven Newbury > <steve@snewbury.org.uk> wrote: >> I've created a new quirk utilising an extra PCI resource flag to >> force reallocation of the resource. It's the first approach I've >> had any success at. It does work. Only "Intel Page Flush" now >> gets allocated @0xe0000000! > > Maybe we can be more aggressive with pci=pref_bar to reassign all > pref mem. > > Please check attached patch. I'll give it a go, but not sure if it will work if it causes the GMA 1Mb MEMIO above 4G. From my testing the i915 driver isn't happy with that. Lower part of the framebuffer is corrupted (overlapping something?), and the Xorg driver fails to initialise (just garbage on the screen). Not sure what's happing there, I tried to duplicate your gma_addr patch for the other 64-bit registers read into gtt_addr and reg_addr. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+KoJMACgkQGcb56gMuC6056gCcCLtdrliMEudCY32F5Vobz9+I vc0AnRX0vy6vI9EBtSqxI6KpkHIMQ0o4 =teYN -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 15/04/12 04:21, Yinghai Lu wrote: > On Sat, Apr 14, 2012 at 10:37 AM, Steven Newbury > <steve@snewbury.org.uk> wrote: >> I've created a new quirk utilising an extra PCI resource flag to >> force reallocation of the resource. It's the first approach I've >> had any success at. It does work. Only "Intel Page Flush" now >> gets allocated @0xe0000000! > > Maybe we can be more aggressive with pci=pref_bar to reassign all > pref mem. > > Please check attached patch. Had the same effect as my patch in allocating the 256MB GMA BAR high. 00000000-0000ffff : reserved 00010000-0009efff : System RAM 0009f000-0009ffff : reserved 000c0000-000c7fff : Video ROM 000cf000-000cffff : Adapter ROM 000f0000-000fffff : System ROM 00100000-df65a7ff : System RAM 01000000-0136df3d : Kernel code 0136df3e-0169127f : Kernel data 0172f000-01809fff : Kernel bss df65a800-dfffffff : reserved df65a800-df6fffff : pnp 00:0d df700000-df7fffff : pnp 00:0d f6900000-f69fffff : PCI Bus 0000:09 f69f0000-f69fffff : 0000:09:00.0 f69f0000-f69fffff : tg3 f6a00000-f6bfffff : PCI Bus 0000:0d f6c00000-f6cfffff : PCI Bus 0000:0c f6cfe000-f6cfffff : 0000:0c:00.0 f6cfe000-f6cfffff : iwl4965 f6dfb700-f6dfb7ff : 0000:00:1f.3 f6dfb800-f6dfbfff : 0000:00:1f.2 f6dfb800-f6dfbfff : ahci f6dfc000-f6dfffff : 0000:00:1b.0 f6dfc000-f6dfffff : ICH HD audio f6e00000-f6efffff : 0000:00:02.0 f6f00000-f6ffffff : 0000:00:02.1 f8000000-fbffffff : PCI MMCONFIG 0000 [bus 00-3f] f8000000-fbffffff : reserved f8000000-fbffffff : pnp 00:0d fec00000-fec0ffff : reserved fec00000-fec003ff : IOAPIC 0 fed00000-fed003ff : HPET 0 fed00000-fed003ff : pnp 00:08 fed18000-fed1bfff : reserved fed18000-fed1bfff : pnp 00:0d fed1c000-fed1c3ff : 0000:00:1d.7 fed1c000-fed1c3ff : ehci_hcd fed1c400-fed1c7ff : 0000:00:1a.7 fed1c400-fed1c7ff : ehci_hcd fed1d000-fed1dfff : Intel Flush Page fed20000-fed8ffff : reserved fed20000-fed3ffff : pnp 00:0d fed40000-fed44fff : pnp 00:0a fed45000-fed8ffff : pnp 00:0d feda0000-feda5fff : reserved feda0000-feda3fff : pnp 00:0d feda4000-feda4fff : pnp 00:0d feda5000-feda5fff : pnp 00:0d feda6000-feda6fff : pnp 00:0d fee00000-fee0ffff : reserved fee00000-fee0ffff : pnp 00:0d fee00000-fee00fff : Local APIC fef00000-feffffff : PCI Bus 0000:04 fefbc000-fefbffff : 0000:04:00.1 fefbc000-fefbffff : ICH HD audio fefc0000-fefdffff : 0000:04:00.0 fefe0000-feffffff : 0000:04:00.0 ffa00000-ffbfffff : pnp 00:0d ffc00000-ffdfffff : PCI Bus 0000:0b ffe00000-ffffffff : reserved ffe00000-ffffffff : pnp 00:0d 100000000-11fffffff : System RAM fef800000-fef9fffff : PCI Bus 0000:09 fefa00000-fefbfffff : PCI Bus 0000:0d fefc00000-fefdfffff : PCI Bus 0000:0c fefe00000-fefffffff : PCI Bus 0000:0b ff0000000-fffffffff : 0000:00:02.0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+KsYMACgkQGcb56gMuC62iIQCfWJ7oLOrcL/88YzalEzIrWY/a LbgAnjzqkflQKzJVDhs0qQ/gxQ1a9FXH =/ae3 -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
commit 7063b1e2145bca02bbdd807d3c2ca97748deb73a Author: Steven Newbury <steve@snewbury.org.uk> 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)