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>
struct page *page = pfn_to_page(fcp_args->pfn);
int exec = vma->vm_flags & VM_EXEC;
struct mm_struct *mm = vma->vm_mm;
struct page *page = pfn_to_page(fcp_args->pfn);
int exec = vma->vm_flags & VM_EXEC;
struct mm_struct *mm = vma->vm_mm;
pgd_t *pgdp;
pud_t *pudp;
pmd_t *pmdp;
pgd_t *pgdp;
pud_t *pudp;
pmd_t *pmdp;
* Use kmap_coherent or kmap_atomic to do flushes for
* another ASID than the current one.
*/
* Use kmap_coherent or kmap_atomic to do flushes for
* another ASID than the current one.
*/
- if (cpu_has_dc_aliases)
+ map_coherent = (cpu_has_dc_aliases &&
+ page_mapped(page) && !Page_dcache_dirty(page));
+ if (map_coherent)
vaddr = kmap_coherent(page, addr);
else
vaddr = kmap_atomic(page, KM_USER0);
vaddr = kmap_coherent(page, addr);
else
vaddr = kmap_atomic(page, KM_USER0);
- if (cpu_has_dc_aliases)
kunmap_coherent();
else
kunmap_atomic(vaddr, KM_USER0);
kunmap_coherent();
else
kunmap_atomic(vaddr, KM_USER0);