mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: Zhao Yakui <yakui.zhao@intel.com>, Ingo Molnar <mingo@elte.hu>,
	lenb@kernel.org
Cc: linux-acpi <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] acpi based pci gap caluculation v2
Date: Wed, 25 Jun 2008 11:22:40 -0700	[thread overview]
Message-ID: <1214418160.27577.87.camel@promb-2n-dhcp368.eng.vmware.com> (raw)
In-Reply-To: <1214413073.27577.67.camel@promb-2n-dhcp368.eng.vmware.com>

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;



  reply	other threads:[~2008-06-25 18:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24 18:48 Alok Kataria
2008-06-25  2:49 ` Zhao Yakui
2008-06-25  4:17   ` Alok kataria
2008-06-25  5:39     ` Zhao Yakui
2008-06-25  6:04       ` Alok kataria
2008-06-25  8:38         ` Zhao Yakui
2008-06-25 16:57           ` Alok Kataria
2008-06-25 18:22             ` Alok Kataria [this message]
2008-06-26  1:00             ` Zhao Yakui
2008-06-26  1:18               ` Alok Kataria

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214418160.27577.87.camel@promb-2n-dhcp368.eng.vmware.com \
    --to=akataria@vmware.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yakui.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®