diff options
author | Linus Torvalds <torvalds@osdl.org> | 2006-02-22 18:50:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:14 -0500 |
commit | b408cbc704352eccee301e1103b23203ba1c3a0e (patch) | |
tree | 5d0262537d6b3a3406aec61298520c045af9be8b /arch/i386/kernel/setup.c | |
parent | 75cde0e25787c1af341a128b350c36df24e5397d (diff) |
[PATCH] PCI: resource address mismatch
On Tue, 21 Feb 2006, Ivan Kokshaysky wrote:
> There are two bogus entries in the BIOS memory map table which are
> conflicting with a prefetchable memory range of the AGP bridge:
>
> BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
> BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
>
> 0000:00:02.0 PCI bridge: Silicon Integrated Systems [SiS] Virtual PCI-to-PCI bridge (AGP) (prog-if 00 [Normal decode])
> Flags: bus master, fast devsel, latency 0
> Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> I/O behind bridge: 0000c000-0000cfff
> Memory behind bridge: e7e00000-e7efffff
> Prefetchable memory behind bridge: fec00000-ffcfffff
> ^^^^^^^^^^^^^^^^^
Yes. However, it's pretty clear that the e820 entries are there for a
reason. Probably they are a hack by the BIOS maintainers to keep Windows
from stomping/moving that region, exactly because they want to keep the
bridge where it is (or, it's actually for the BIOS itself - the BIOS
tables are a horrid mess, and BIOS engineers are pretty hacky people:
they'll add random entries to make their own broken algorithms do the
"right thing").
> Starting from 2.6.13, kernel tries to resolve that sort of conflicts,
> so that prefetch window of the bridge and the framebuffer memory behind
> it get moved to 0x10000000.
I think we could (and probably should) solve this another way: consider
the ACPI "reserved regions" from the e820 map exactly the same way that we
do other ACPI hints - they should restrict _new_ allocations, but not
impact stuff we figure out on our own.
Basically, right now we assign _unassigned_ resources at "fs_initcall"
time. If we were to add in the e820 "reserved region" stuff before that
(but after we've done PCI discovery), we'd probably do the right thing.
Right now we do the e820 reserved regions very early indeed: we call
"register_memory()" from setup_arch(). We could move at least part of it
(the part that registers the resources) down a bit.
Here's a test-patch. I'm not saying we should absolutely do this, but it
might be interesting to try...
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: <bjk@luxsci.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r-- | arch/i386/kernel/setup.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 2d8782960f41..d313a11acafa 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -1288,7 +1288,7 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1288 | struct resource *res; | 1288 | struct resource *res; |
1289 | if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) | 1289 | if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) |
1290 | continue; | 1290 | continue; |
1291 | res = alloc_bootmem_low(sizeof(struct resource)); | 1291 | res = kzalloc(sizeof(struct resource), GFP_ATOMIC); |
1292 | switch (e820.map[i].type) { | 1292 | switch (e820.map[i].type) { |
1293 | case E820_RAM: res->name = "System RAM"; break; | 1293 | case E820_RAM: res->name = "System RAM"; break; |
1294 | case E820_ACPI: res->name = "ACPI Tables"; break; | 1294 | case E820_ACPI: res->name = "ACPI Tables"; break; |
@@ -1316,13 +1316,15 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1316 | 1316 | ||
1317 | /* | 1317 | /* |
1318 | * Request address space for all standard resources | 1318 | * Request address space for all standard resources |
1319 | * | ||
1320 | * This is called just before pcibios_assign_resources(), which is also | ||
1321 | * an fs_initcall, but is linked in later (in arch/i386/pci/i386.c). | ||
1319 | */ | 1322 | */ |
1320 | static void __init register_memory(void) | 1323 | static int __init request_standard_resources(void) |
1321 | { | 1324 | { |
1322 | unsigned long gapstart, gapsize, round; | 1325 | int i; |
1323 | unsigned long long last; | ||
1324 | int i; | ||
1325 | 1326 | ||
1327 | printk("Setting up standard PCI resources\n"); | ||
1326 | if (efi_enabled) | 1328 | if (efi_enabled) |
1327 | efi_initialize_iomem_resources(&code_resource, &data_resource); | 1329 | efi_initialize_iomem_resources(&code_resource, &data_resource); |
1328 | else | 1330 | else |
@@ -1334,6 +1336,16 @@ static void __init register_memory(void) | |||
1334 | /* request I/O space for devices used on all i[345]86 PCs */ | 1336 | /* request I/O space for devices used on all i[345]86 PCs */ |
1335 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) | 1337 | for (i = 0; i < STANDARD_IO_RESOURCES; i++) |
1336 | request_resource(&ioport_resource, &standard_io_resources[i]); | 1338 | request_resource(&ioport_resource, &standard_io_resources[i]); |
1339 | return 0; | ||
1340 | } | ||
1341 | |||
1342 | fs_initcall(request_standard_resources); | ||
1343 | |||
1344 | static void __init register_memory(void) | ||
1345 | { | ||
1346 | unsigned long gapstart, gapsize, round; | ||
1347 | unsigned long long last; | ||
1348 | int i; | ||
1337 | 1349 | ||
1338 | /* | 1350 | /* |
1339 | * Search for the bigest gap in the low 32 bits of the e820 | 1351 | * Search for the bigest gap in the low 32 bits of the e820 |