Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3be4e6990edf65624cfcbf8f7e33810626b2eefa
Commit:     3be4e6990edf65624cfcbf8f7e33810626b2eefa
Parent:     a741e67969577163a4cfc78d7fd2753219087ef1
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 12 15:30:21 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Fri Apr 13 04:09:39 2007 +1000

    [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 <[EMAIL PROTECTED]>
    
     arch/powerpc/mm/pgtable_32.c |    9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/mm/pgtable_32.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index c284bda..95d3afe 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)
        pg = pte_alloc_kernel(pd, va);
        if (pg != 0) {
                err = 0;
-               set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, 
__pgprot(flags)));
-               if (mem_init_done)
-                       flush_HPTE(0, va, pmd_val(*pd));
+               /* The PTE should never be already set nor present in the
+                * hash table
+                */
+               BUG_ON(pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE));
+               set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
+                                                    __pgprot(flags)));
        }
        return err;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to