PCI: clear bridge resource range if BIOS assigned bad one

Yannick found that video does not work with 2.6.34. The cause of this
bug was that the BIOS had assigned the wrong range to the PCI bridge
above the video device. Before 2.6.34 the kernel would have shrunk
the size of the bridge window, but since
d65245c PCI: don't shrink bridge resources
the kernel will avoid shrinking BIOS ranges.

So zero out the old range if we fail to claim it at boot time; this will
cause us to allocate a new range at startup, restoring the 2.6.34
behavior.

Fixes regression https://bugzilla.kernel.org/show_bug.cgi?id=16009.

Reported-by: Yannick <yannick.roehlly@free.fr>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by Yinghai Lu and committed by Jesse Barnes 837c4ef1 a7ef7d1f

+5
+1
arch/microblaze/pci/pci-common.c
··· 1277 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1278 "%d of PCI bridge %d, will remap\n", i, bus->number); 1279 clear_resource: 1280 res->flags = 0; 1281 } 1282
··· 1277 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1278 "%d of PCI bridge %d, will remap\n", i, bus->number); 1279 clear_resource: 1280 + res->start = res->end = 0; 1281 res->flags = 0; 1282 } 1283
+1
arch/mn10300/unit-asb2305/pci-asb2305.c
··· 117 * Invalidate the resource to prevent 118 * child resource allocations in this 119 * range. */ 120 r->flags = 0; 121 } 122 }
··· 117 * Invalidate the resource to prevent 118 * child resource allocations in this 119 * range. */ 120 + r->start = r->end = 0; 121 r->flags = 0; 122 } 123 }
+1
arch/powerpc/kernel/pci-common.c
··· 1309 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1310 "%d of PCI bridge %d, will remap\n", i, bus->number); 1311 clear_resource: 1312 res->flags = 0; 1313 } 1314
··· 1309 printk(KERN_WARNING "PCI: Cannot allocate resource region " 1310 "%d of PCI bridge %d, will remap\n", i, bus->number); 1311 clear_resource: 1312 + res->start = res->end = 0; 1313 res->flags = 0; 1314 } 1315
+2
arch/x86/pci/i386.c
··· 96 * the fact the PCI specs explicitly allow address decoders to be 97 * shared between expansion ROMs and other resource regions, it's 98 * at least dangerous) 99 * 100 * Our solution: 101 * (1) Allocate resources for all buses behind PCI-to-PCI bridges. ··· 137 * child resource allocations in this 138 * range. 139 */ 140 r->flags = 0; 141 } 142 }
··· 96 * the fact the PCI specs explicitly allow address decoders to be 97 * shared between expansion ROMs and other resource regions, it's 98 * at least dangerous) 99 + * - bad resource sizes or overlaps with other regions 100 * 101 * Our solution: 102 * (1) Allocate resources for all buses behind PCI-to-PCI bridges. ··· 136 * child resource allocations in this 137 * range. 138 */ 139 + r->start = r->end = 0; 140 r->flags = 0; 141 } 142 }