linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM:mm: fix kmap_atomic_to_page
@ 2015-10-06 11:09 Chanho Min
  2015-10-06 19:28 ` Russell King - ARM Linux
  2015-10-12  6:00 ` yalin wang
  0 siblings, 2 replies; 10+ messages in thread
From: Chanho Min @ 2015-10-06 11:09 UTC (permalink / raw)
  To: linux-arm-kernel

Since kmap_atomic returns the pkmap address without a new mapping to
fixmap for the page that is already mapped by kmap, It should be
considered for the pkmap address in kmap_atomic_to_page.

Signed-off-by: Chanho Min <chanho.min@lge.com>
---
 arch/arm/mm/highmem.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index 45aeaac..3e973b7 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -145,8 +145,13 @@ struct page *kmap_atomic_to_page(const void *ptr)
 {
 	unsigned long vaddr = (unsigned long)ptr;
 
-	if (vaddr < FIXADDR_START)
-		return virt_to_page(ptr);
+	if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) {
+		int i = PKMAP_NR(vaddr);
+		return pte_page(pkmap_page_table[i]);
+	}
+
+	if (vaddr >= FIXADDR_START)
+		return pte_page(get_fixmap_pte(vaddr));
 
-	return pte_page(get_fixmap_pte(vaddr));
+	return virt_to_page(ptr);
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-10-13 11:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 11:09 [PATCH] ARM:mm: fix kmap_atomic_to_page Chanho Min
2015-10-06 19:28 ` Russell King - ARM Linux
2015-10-07  1:37   ` Nicolas Pitre
2015-10-07  3:55     ` Jongsung Kim
2015-10-07  9:01       ` Russell King - ARM Linux
2015-10-12  5:30         ` Jongsung Kim
2015-10-12  9:27           ` Arnd Bergmann
2015-10-13  2:06             ` Jongsung Kim
2015-10-13 11:44               ` Arnd Bergmann
2015-10-12  6:00 ` yalin wang

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).