Skip to contentSkip to conversation

mm: fix misuse of debug_kmap_atomic

PATCH In review Akinobu Mita 1 participant 2 messages Apr 2, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: fix misuse of debug_kmap_atomic

Commit 7ca43e7564679604d86e9ed834e7bbcffd8a4a3f (mm: use debug_kmap_atomic) introduced some debug_kmap_atomic() in wrong places.

---

arch/x86/mm/highmem_32.c +0 -1
index 5bc5d16..8126e8d 100644
@@ -40,7 +40,6 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
 
 	debug_kmap_atomic(type);
 
-	debug_kmap_atomic(type);
 	idx = type + KM_TYPE_NR*smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 	BUG_ON(!pte_none(*(kmap_pte-idx)));
arch/x86/mm/iomap_32.c +1 -1
index bff0c90..e331f77 100644
@@ -39,6 +39,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
 
 	pagefault_disable();
 
+	debug_kmap_atomic(type);
 	idx = type + KM_TYPE_NR * smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 	set_pte(kmap_pte - idx, pfn_pte(pfn, prot));
@@ -72,7 +73,6 @@ iounmap_atomic(void *kvaddr, enum km_type type)
 	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
 
-	debug_kmap_atomic(type);
 	/*
 	 * Force other mappings to Oops if they'll try to access this pte
 	 * without first remap it.  Keeping stale mappings around is a bad idea
#1 lore raw

[tip:x86/urgent] x86, mm: fix misuse of debug_kmap_atomic

Commit-ID:  a7f8c50d90a4e983c456ae75e534b5cd6c03674b
Gitweb:     http://git.kernel.org/tip/a7f8c50d90a4e983c456ae75e534b5cd6c03674b
Author:     Akinobu Mita <[email protected]>
AuthorDate: Thu, 2 Apr 2009 16:01:26 +0900
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 2 Apr 2009 16:37:04 +0200

x86, mm: fix misuse of debug_kmap_atomic

Impact: fix CONFIG_DEBUG_HIGHMEM=y breakage

Commit 7ca43e756 ("mm: use debug_kmap_atomic") introduced some debug_kmap_atomic() calls in the wrong places.

Cc Andrew Morton <[email protected]>
Cc Linus Torvalds <[email protected]>

LKML-Reference: <[email protected]>

---
 arch/x86/mm/highmem_32.c |    1 -
 arch/x86/mm/iomap_32.c   |    2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/mm/highmem_32.c +0 -1
index 5bc5d16..8126e8d 100644
@@ -40,7 +40,6 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
 
 	debug_kmap_atomic(type);
 
-	debug_kmap_atomic(type);
 	idx = type + KM_TYPE_NR*smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 	BUG_ON(!pte_none(*(kmap_pte-idx)));
arch/x86/mm/iomap_32.c +1 -1
index bff0c90..e331f77 100644
@@ -39,6 +39,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
 
 	pagefault_disable();
 
+	debug_kmap_atomic(type);
 	idx = type + KM_TYPE_NR * smp_processor_id();
 	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
 	set_pte(kmap_pte - idx, pfn_pte(pfn, prot));
@@ -72,7 +73,6 @@ iounmap_atomic(void *kvaddr, enum km_type type)
 	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
 	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
 
-	debug_kmap_atomic(type);
 	/*
 	 * Force other mappings to Oops if they'll try to access this pte
 	 * without first remap it.  Keeping stale mappings around is a bad idea