diff options
Diffstat (limited to 'arch/mips/mm/c-r4k.c')
-rw-r--r-- | arch/mips/mm/c-r4k.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index c41ea2284954..27096751ddce 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -446,6 +446,7 @@ static inline void local_r4k_flush_cache_page(void *args) | |||
446 | struct page *page = pfn_to_page(fcp_args->pfn); | 446 | struct page *page = pfn_to_page(fcp_args->pfn); |
447 | int exec = vma->vm_flags & VM_EXEC; | 447 | int exec = vma->vm_flags & VM_EXEC; |
448 | struct mm_struct *mm = vma->vm_mm; | 448 | struct mm_struct *mm = vma->vm_mm; |
449 | int map_coherent = 0; | ||
449 | pgd_t *pgdp; | 450 | pgd_t *pgdp; |
450 | pud_t *pudp; | 451 | pud_t *pudp; |
451 | pmd_t *pmdp; | 452 | pmd_t *pmdp; |
@@ -479,7 +480,9 @@ static inline void local_r4k_flush_cache_page(void *args) | |||
479 | * Use kmap_coherent or kmap_atomic to do flushes for | 480 | * Use kmap_coherent or kmap_atomic to do flushes for |
480 | * another ASID than the current one. | 481 | * another ASID than the current one. |
481 | */ | 482 | */ |
482 | if (cpu_has_dc_aliases) | 483 | map_coherent = (cpu_has_dc_aliases && |
484 | page_mapped(page) && !Page_dcache_dirty(page)); | ||
485 | if (map_coherent) | ||
483 | vaddr = kmap_coherent(page, addr); | 486 | vaddr = kmap_coherent(page, addr); |
484 | else | 487 | else |
485 | vaddr = kmap_atomic(page, KM_USER0); | 488 | vaddr = kmap_atomic(page, KM_USER0); |
@@ -502,7 +505,7 @@ static inline void local_r4k_flush_cache_page(void *args) | |||
502 | } | 505 | } |
503 | 506 | ||
504 | if (vaddr) { | 507 | if (vaddr) { |
505 | if (cpu_has_dc_aliases) | 508 | if (map_coherent) |
506 | kunmap_coherent(); | 509 | kunmap_coherent(); |
507 | else | 510 | else |
508 | kunmap_atomic(vaddr, KM_USER0); | 511 | kunmap_atomic(vaddr, KM_USER0); |