Re: [PATCH 2/2] acpi based pci gap caluculation v2

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Zhao Yakui <yakui.zhao@...>, Ingo Molnar <mingo@...>, <lenb@...>
Cc: linux-acpi <linux-acpi@...>, LKML <linux-kernel@...>
Date: Wednesday, June 25, 2008 - 2:22 pm

On Wed, 2008-06-25 at 09:57 -0700, Alok Kataria wrote:


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;


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/2] acpi based pci gap caluculation v2, Alok Kataria, (Tue Jun 24, 2:48 pm)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Zhao Yakui, (Tue Jun 24, 10:49 pm)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Alok kataria, (Wed Jun 25, 12:17 am)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Zhao Yakui, (Wed Jun 25, 1:39 am)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Alok kataria, (Wed Jun 25, 2:04 am)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Zhao Yakui, (Wed Jun 25, 4:38 am)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Alok Kataria, (Wed Jun 25, 12:57 pm)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Zhao Yakui, (Wed Jun 25, 9:00 pm)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Alok Kataria, (Wed Jun 25, 9:18 pm)
Re: [PATCH 2/2] acpi based pci gap caluculation v2, Alok Kataria, (Wed Jun 25, 2:22 pm)