aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2007-04-12 01:30:21 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-12 14:09:39 -0400
commit3be4e6990edf65624cfcbf8f7e33810626b2eefa (patch)
treee0da9d35af9cd7779ec1c437ebd661892d586689 /arch
parenta741e67969577163a4cfc78d7fd2753219087ef1 (diff)
[POWERPC] Cleanup 32-bit map_page
The 32 bits map_page() function is used internally by the mm code for early mmu mappings and for ioremap. It should never be called for an address that already has a valid PTE or hash entry, so we add a BUG_ON for that and remove the useless flush_HPTE call. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> arch/powerpc/mm/pgtable_32.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/mm/pgtable_32.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index c284bdac9947..95d3afe36b51 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -266,9 +266,12 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
266 pg = pte_alloc_kernel(pd, va); 266 pg = pte_alloc_kernel(pd, va);
267 if (pg != 0) { 267 if (pg != 0) {
268 err = 0; 268 err = 0;
269 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); 269 /* The PTE should never be already set nor present in the
270 if (mem_init_done) 270 * hash table
271 flush_HPTE(0, va, pmd_val(*pd)); 271 */
272 BUG_ON(pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE));
273 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
274 __pgprot(flags)));
272 } 275 }
273 return err; 276 return err;
274} 277}