[PCI_ACPI] Modify PCI gap calculation

From: Alok Kataria
Date: Thu Jun 19 2008 - 18:57:08 EST


Today, we calculate a gap in the low 32bit address space for PCI devices
to assign MMIO resources for hotplug or unconfigured devices,
(pci_mem_start).
This gap calculation is done by walking the e820 memory space, this
calculation ignores the SRAT for any possible reservations that the
BIOS might have done for memory hotplug. In some cases the
PCI device resources (f.e. Expansion ROMS) end up sharing the address
space with memory hotplug capable regions.

As a result, when we try to hotadd memory to a system which has less
than 4GB memory to start with, we see resource clashes and the hotadd
requests fail.

The solution here is to find a PCI gap in the PCI reserved regions as
exported by the ACPI table. We read the _CRS object under PCI0 for
possible producer regions and search for a big enough unclaimed gap
within these producer regions.

There are 2 patches
1. cleanup of the e820_search_gap function
2. code which walks ACPI resources searching for gap within producer
regions.

I have kept the original e820_find_gap function since in systems with
ACPI disabled we still may need to calculate the gap.

Please have a look.

Thanks,
Alok

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/