diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2008-06-14 17:22:08 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-06-16 10:14:48 -0400 |
commit | c9c5023d83df5dc7d58830a63fd0e082120f00e3 (patch) | |
tree | 7c0bc5cca357aae84e8bb6c0544da5b04ea6d77b /arch/mips/mm/c-r4k.c | |
parent | 0c3bd83b0974238a5808d342663c6407512564d0 (diff) |
[MIPS] Fix buggy use of kmap_coherent.
Assuming the call of kmap_coherent in local_r4k_flush_cache_page doesn't
need fixing this was skipped in fcae549295bcae801ac48fc1c2030ab8cc487020.
Turns out it needed the same change after all.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
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); |