diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-12-29 01:40:35 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-08 00:25:17 -0500 |
commit | 7021d86afa6f3a8bf76218ac97f5847a6d985730 (patch) | |
tree | fb12712d5ff3ec34514c2799736263507de1918d /arch/powerpc | |
parent | 02af87a74271977d09ece9b709909dcae3f9fab9 (diff) |
powerpc/mm: 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 <avorontsov@ru.mvista.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/pgtable_32.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index 38ff35f2142a..22972cd83cc9 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -266,7 +266,8 @@ int map_page(unsigned long va, phys_addr_t pa, int flags) | |||
266 | /* The PTE should never be already set nor present in the | 266 | /* The PTE should never be already set nor present in the |
267 | * hash table | 267 | * hash table |
268 | */ | 268 | */ |
269 | BUG_ON(pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)); | 269 | BUG_ON((pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)) && |
270 | flags); | ||
270 | set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, | 271 | set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, |
271 | __pgprot(flags))); | 272 | __pgprot(flags))); |
272 | } | 273 | } |