linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: venkatesh.pallipadi@intel.com
To: mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Subject: [patch 1/6] x86, CPA: Change idmap attribute before ioremap attribute setup
Date: Thu, 09 Apr 2009 14:26:47 -0700	[thread overview]
Message-ID: <20090409212708.373330000@intel.com> (raw)
In-Reply-To: 20090409212646.511925000@intel.com

[-- Attachment #1: 0001-x86-CPA-Change-idmap-attribute-before-ioremap-attr.patch --]
[-- Type: text/plain, Size: 1589 bytes --]

From: Suresh Siddha <suresh.b.siddha@intel.com>
Subject: [patch 1/6] x86, CPA: Change idmap attribute before ioremap attribute setup

Change the identity mapping with the requested attribute first, before
we setup the virtual memory mapping with the new requested attribute.
This makes sure that there is no window when identity map'ed attribute
may disagree with ioremap range on the attribute type.
This also avoids doing cpa on the ioremap'ed address twice (first in
ioremap_page_range and then in ioremap_change_attr using vaddr), and
should improve ioremap performance a bit.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
 arch/x86/mm/ioremap.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 0dfa09d..329387e 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -280,15 +280,16 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
 		return NULL;
 	area->phys_addr = phys_addr;
 	vaddr = (unsigned long) area->addr;
-	if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) {
+
+	if (kernel_map_sync_memtype(phys_addr, size, prot_val)) {
 		free_memtype(phys_addr, phys_addr + size);
 		free_vm_area(area);
 		return NULL;
 	}
 
-	if (ioremap_change_attr(vaddr, size, prot_val) < 0) {
+	if (ioremap_page_range(vaddr, vaddr + size, phys_addr, prot)) {
 		free_memtype(phys_addr, phys_addr + size);
-		vunmap(area->addr);
+		free_vm_area(area);
 		return NULL;
 	}
 
-- 
1.6.0.6

-- 


  reply	other threads:[~2009-04-09 22:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-09 21:26 [patch 0/6] x86, PAT, CPA: Cleanups and minor bug fixes venkatesh.pallipadi
2009-04-09 21:26 ` venkatesh.pallipadi [this message]
2009-04-10 12:33   ` [tip:x86/pat] x86, CPA: Change idmap attribute before ioremap attribute setup Suresh Siddha
2009-04-09 21:26 ` [patch 2/6] x86, PAT: Change order of cpa and free in set_memory_wb venkatesh.pallipadi
2009-04-10 12:34   ` [tip:x86/pat] " venkatesh.pallipadi
2009-04-09 21:26 ` [patch 3/6] x86, PAT: Handle faults cleanly in set_memory_ APIs venkatesh.pallipadi
2009-04-10 12:34   ` [tip:x86/pat] " venkatesh.pallipadi
2009-04-09 21:26 ` [patch 4/6] x86, PAT: Changing memtype to WC ensuring no WB alias venkatesh.pallipadi
2009-04-10 12:34   ` [tip:x86/pat] " venkatesh.pallipadi
2009-04-09 21:26 ` [patch 5/6] x86, PAT: Consolidate code in pat_x_mtrr_type() and reserve_memtype() venkatesh.pallipadi
2009-04-10 12:34   ` [tip:x86/pat] " Suresh Siddha
2009-04-09 21:26 ` [patch 6/6] x86, PAT: Remove duplicate memtype reserve in devmem mmap venkatesh.pallipadi
2009-04-10 12:34   ` [tip:x86/pat] " Suresh Siddha
2009-04-10 11:53 ` [patch 0/6] x86, PAT, CPA: Cleanups and minor bug fixes Ingo Molnar
2009-04-10 17:31   ` Pallipadi, Venkatesh
2009-04-10 20:41 ` Eric Anholt
2009-04-11  7:00   ` Ingo Molnar
2009-04-13 20:11     ` Eric Anholt

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=20090409212708.373330000@intel.com \
    --to=venkatesh.pallipadi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).