]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-sparc64/tlb.h
[ARM] 3537/1: Rework DMA-bounce locking for finer granularity
[linux-2.6-omap-h63xx.git] / include / asm-sparc64 / tlb.h
index 66138d959df5e25be7ceaed865f3873f8ae51a18..7af1e1109c49e1f5092f44914601f98624b96a5a 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _SPARC64_TLB_H
 #define _SPARC64_TLB_H
 
-#include <linux/config.h>
 #include <linux/swap.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
@@ -58,11 +57,9 @@ static inline struct mmu_gather *tlb_gather_mmu(struct mm_struct *mm, unsigned i
 static inline void tlb_flush_mmu(struct mmu_gather *mp)
 {
        if (mp->need_flush) {
+               free_pages_and_swap_cache(mp->pages, mp->pages_nr);
+               mp->pages_nr = 0;
                mp->need_flush = 0;
-               if (!tlb_fast_mode(mp)) {
-                       free_pages_and_swap_cache(mp->pages, mp->pages_nr);
-                       mp->pages_nr = 0;
-               }
        }
 
 }
@@ -78,11 +75,9 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
 {
        tlb_flush_mmu(mp);
 
-       if (mp->fullmm) {
-               if (CTX_VALID(mp->mm->context))
-                       do_flush_tlb_mm(mp->mm);
+       if (mp->fullmm)
                mp->fullmm = 0;
-       else
+       else
                flush_tlb_pending();
 
        /* keep the page table cache within bounds */
@@ -93,11 +88,11 @@ static inline void tlb_finish_mmu(struct mmu_gather *mp, unsigned long start, un
 
 static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
 {
-       mp->need_flush = 1;
        if (tlb_fast_mode(mp)) {
                free_page_and_swap_cache(page);
                return;
        }
+       mp->need_flush = 1;
        mp->pages[mp->pages_nr++] = page;
        if (mp->pages_nr >= FREE_PTE_NR)
                tlb_flush_mmu(mp);