Messages in this thread Patch in this message | | | Subject | Re: [PATCH 2/2] acpi based pci gap caluculation v2 | From | Alok Kataria <> | Date | Wed, 25 Jun 2008 11:22:40 -0700 |
| |
On Wed, 2008-06-25 at 09:57 -0700, Alok Kataria wrote:
> While writing this mail i figured out that, instead of searching from > start_addr of _CRS to 2^32 we should just search till *end_addr* of _CRS resource. > I will send a patch to that effect. > > Thanks, > Alok >
Ingo, Please also apply this patch to the tip/out-of-tree --
Incremental patch . This patch passes the pci producer resources end_addr (got from _CRS) to the e820_search_gap function. Without this patch the code will always search from the producer regions start_address to 2^32, even though the producer region may be smaller.
Now , we limit the search only within the producer region's address space. Also we put a condition to check if the resource lies in the 32bit address range.
Signed-off-by: Alok N Kataria <akataria@vmware.com>
Index: linux-x86-tree.git/arch/x86/pci/acpi.c =================================================================== --- linux-x86-tree.git.orig/arch/x86/pci/acpi.c 2008-06-25 10:11:35.000000000 -0700 +++ linux-x86-tree.git/arch/x86/pci/acpi.c 2008-06-25 11:17:31.000000000 -0700 @@ -121,13 +121,21 @@ struct acpi_resource_address64 addr; acpi_status status; struct gap_info *gap = data; + unsigned long long start_addr, end_addr; status = resource_to_addr(resource, &addr); if (ACPI_SUCCESS(status) && addr.resource_type == ACPI_MEMORY_RANGE && addr.address_length > gap->gapsize) { - e820_search_gap(&gap->gapstart, &gap->gapsize, - (addr.minimum + addr.translation_offset)); + start_addr = addr.minimum + addr.translation_offset; + /* + * We want space only in the 32bit address range + */ + if (start_addr < UINT_MAX) { + end_addr = start_addr + addr.address_length; + e820_search_gap(&gap->gapstart, &gap->gapsize, + start_addr, end_addr); + } } return AE_OK;
| |