Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ca43e75 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

mm: use debug_kmap_atomic



Use debug_kmap_atomic in kmap_atomic, kmap_atomic_pfn, and
iomap_atomic_prot_pfn.

Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f4112de6
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -42,6 +42,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
	if (!PageHighMem(page))
	if (!PageHighMem(page))
		return page_address(page);
		return page_address(page);


	debug_kmap_atomic(type);
	idx = type + KM_TYPE_NR*smp_processor_id();
	idx = type + KM_TYPE_NR*smp_processor_id();
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
#ifdef CONFIG_DEBUG_HIGHMEM
#ifdef CONFIG_DEBUG_HIGHMEM
@@ -88,6 +89,7 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)


	pagefault_disable();
	pagefault_disable();


	debug_kmap_atomic(type);
	idx = type + KM_TYPE_NR*smp_processor_id();
	idx = type + KM_TYPE_NR*smp_processor_id();
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
	set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
+2 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@


#include <linux/init.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/highmem.h>
#include <asm/kmap_types.h>
#include <asm/kmap_types.h>
#include <asm/tlbflush.h>
#include <asm/tlbflush.h>
#include <asm/page.h>
#include <asm/page.h>
@@ -94,6 +95,7 @@ static inline void *kmap_atomic_prot(struct page *page, enum km_type type, pgpro
	if (!PageHighMem(page))
	if (!PageHighMem(page))
		return page_address(page);
		return page_address(page);


	debug_kmap_atomic(type);
	idx = type + KM_TYPE_NR*smp_processor_id();
	idx = type + KM_TYPE_NR*smp_processor_id();
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
#ifdef CONFIG_DEBUG_HIGHMEM
#ifdef CONFIG_DEBUG_HIGHMEM
+1 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
	if (!PageHighMem(page))
	if (!PageHighMem(page))
		return page_address(page);
		return page_address(page);


	debug_kmap_atomic(type);
	idx = type + KM_TYPE_NR*smp_processor_id();
	idx = type + KM_TYPE_NR*smp_processor_id();
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);


+1 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)


	debug_kmap_atomic(type);
	debug_kmap_atomic(type);


	debug_kmap_atomic(type);
	idx = type + KM_TYPE_NR*smp_processor_id();
	idx = type + KM_TYPE_NR*smp_processor_id();
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
	BUG_ON(!pte_none(*(kmap_pte-idx)));
	BUG_ON(!pte_none(*(kmap_pte-idx)));
+2 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include <asm/iomap.h>
#include <asm/iomap.h>
#include <asm/pat.h>
#include <asm/pat.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/highmem.h>


int is_io_mapping_possible(resource_size_t base, unsigned long size)
int is_io_mapping_possible(resource_size_t base, unsigned long size)
{
{
@@ -71,6 +72,7 @@ iounmap_atomic(void *kvaddr, enum km_type type)
	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
	unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
	enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
	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
	 * 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
	 * without first remap it.  Keeping stale mappings around is a bad idea
Loading