[PATCH] arm: Get proper pte for fixmaps

From: Laura Abbott
Date: Wed Aug 06 2014 - 22:20:46 EST


The generic fixmap.h gets indexes from high to low instead
of low to high so the fixmap idx does not correspond to
the array entry in fixmap_page_table. Get the proper pte
to update.

Signed-off-by: Laura Abbott <lauraa@xxxxxxxxxxxxxx>
---
arch/arm/mm/highmem.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index bedca3a..7f08e64 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -22,14 +22,18 @@
static inline void set_fixmap_pte(int idx, pte_t pte)
{
unsigned long vaddr = __fix_to_virt(idx);
- set_pte_ext(fixmap_page_table + idx, pte, 0);
+ pte_t *ppte = pte_offset_kernel(pmd_off_k(FIXADDR_START), vaddr);
+
+ set_pte_ext(ppte, pte, 0);
local_flush_tlb_kernel_page(vaddr);
}

static inline pte_t get_fixmap_pte(unsigned long vaddr)
{
unsigned long idx = __virt_to_fix(vaddr);
- return *(fixmap_page_table + idx);
+ pte_t *ppte = pte_offset_kernel(pmd_off_k(FIXADDR_START), vaddr);
+
+ return *ppte;
}

void *kmap(struct page *page)
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/