diff options
-rw-r--r-- | arch/powerpc/mm/pgtable_32.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index f54fb9d3927a..f4e5ac122615 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -279,18 +279,16 @@ map_page(unsigned long va, phys_addr_t pa, int flags) | |||
279 | pte_t *pg; | 279 | pte_t *pg; |
280 | int err = -ENOMEM; | 280 | int err = -ENOMEM; |
281 | 281 | ||
282 | spin_lock(&init_mm.page_table_lock); | ||
283 | /* Use upper 10 bits of VA to index the first level map */ | 282 | /* Use upper 10 bits of VA to index the first level map */ |
284 | pd = pmd_offset(pgd_offset_k(va), va); | 283 | pd = pmd_offset(pgd_offset_k(va), va); |
285 | /* Use middle 10 bits of VA to index the second-level map */ | 284 | /* Use middle 10 bits of VA to index the second-level map */ |
286 | pg = pte_alloc_kernel(&init_mm, pd, va); | 285 | pg = pte_alloc_kernel(pd, va); |
287 | if (pg != 0) { | 286 | if (pg != 0) { |
288 | err = 0; | 287 | err = 0; |
289 | set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); | 288 | set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); |
290 | if (mem_init_done) | 289 | if (mem_init_done) |
291 | flush_HPTE(0, va, pmd_val(*pd)); | 290 | flush_HPTE(0, va, pmd_val(*pd)); |
292 | } | 291 | } |
293 | spin_unlock(&init_mm.page_table_lock); | ||
294 | return err; | 292 | return err; |
295 | } | 293 | } |
296 | 294 | ||