powerpc/32: Make clear_fixmap actually work
PATCH 2/4 powerpc/32: Make clear_fixmap actually work
The clear_fixmap() routine issues map_page() with flags set to 0. Currently this causes a BUG_ON() inside the map_page(), as it assumes that a PTE should be clear before mapping.
This patch makes the map_page() to trigger the BUG_ON() only if the flags were set.
Signed-off-by Anton Vorontsov <[email protected]>
--- arch/powerpc/mm/pgtable_32.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/mm/pgtable_32.c +2 -1
@@ -259,7 +259,8 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)/* The PTE should never be already set nor present in the * hash table */ -BUG_ON (pte_val (*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)); +BUG_ON ((pte_val (*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)) && + flags);set_pte_at (&init_mm, va, pg,pfn_pte (pa >>PAGE_SHIFT ,__pgprot (flags))); }
Signature · 1 line
1.5.6.5
Quoted 26 lines · Anton Vorontsov
The
clear_fixmap()routine issuesmap_page()with flags set to 0. Currently this causes aBUG_ON()inside themap_page(), as it assumes that a PTE should be clear before mapping.This patch makes the
map_page()to trigger theBUG_ON()only if the flags were set.Signed-off-by Anton Vorontsov <[email protected]>---
arch/powerpc/mm/pgtable_32.c| 3 ++-1 files changed, 2 insertions(+), 1 deletions(-)arch/powerpc/mm/pgtable_32.c +2
-1@@ -259,7 +259,8 @@ int map_page(unsigned long va, phys_addr_t pa, int flags) /* The PTE should never be already set nor present in the * hash table */ - BUG_ON(pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)); + BUG_ON((pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)) && + flags);set_pte_at (&init_mm, va, pg,pfn_pte (pa >>PAGE_SHIFT ,__pgprot (flags)));
Quoted 1 line
}
Acked-by Kumar Gala <[email protected]>
- k