Commit e2f2e58e authored by Paul Mackerras's avatar Paul Mackerras

powerpc: import a fix from arch/ppc/mm/pgtable.c

... namely, the change to the 2-argument pte_alloc_kernel.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 734d6524
...@@ -279,18 +279,16 @@ map_page(unsigned long va, phys_addr_t pa, int flags) ...@@ -279,18 +279,16 @@ map_page(unsigned long va, phys_addr_t pa, int flags)
pte_t *pg; pte_t *pg;
int err = -ENOMEM; int err = -ENOMEM;
spin_lock(&init_mm.page_table_lock);
/* Use upper 10 bits of VA to index the first level map */ /* Use upper 10 bits of VA to index the first level map */
pd = pmd_offset(pgd_offset_k(va), va); pd = pmd_offset(pgd_offset_k(va), va);
/* Use middle 10 bits of VA to index the second-level map */ /* Use middle 10 bits of VA to index the second-level map */
pg = pte_alloc_kernel(&init_mm, pd, va); pg = pte_alloc_kernel(pd, va);
if (pg != 0) { if (pg != 0) {
err = 0; err = 0;
set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags))); set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, __pgprot(flags)));
if (mem_init_done) if (mem_init_done)
flush_HPTE(0, va, pmd_val(*pd)); flush_HPTE(0, va, pmd_val(*pd));
} }
spin_unlock(&init_mm.page_table_lock);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment