diff options
author | Roy Pledge <Roy.Pledge@freescale.com> | 2015-07-14 21:22:02 (GMT) |
---|---|---|
committer | Roy Pledge <Roy.Pledge@freescale.com> | 2015-11-03 19:24:40 (GMT) |
commit | e98f36e86bdfbeb1728ab0de4f2be367d6283963 (patch) | |
tree | 5852c15132ec6d6c8631ed30d93a16ceb09d9ae7 /arch | |
parent | 67ef9d132bb8d6e91863160e56ec62291c8b2be7 (diff) | |
download | linux-fsl-qoriq-e98f36e86bdfbeb1728ab0de4f2be367d6283963.tar.xz |
fsl_usdpaa: Remove TLB entries when unmapping memory
TLB1 entries must be removed when unmapping a DMA map from a
process so they don't point to the wrong physical memory if
a new map reuses the same virtual address
Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/mm/fsl_booke_mmu.c | 12 | ||||
-rw-r--r-- | arch/powerpc/mm/mmu_decl.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c index e52e121..360a0ce 100644 --- a/arch/powerpc/mm/fsl_booke_mmu.c +++ b/arch/powerpc/mm/fsl_booke_mmu.c @@ -147,6 +147,18 @@ void settlbcam(int index, unsigned long virt, phys_addr_t phys, loadcam_entry(index); } +void cleartlbcam(unsigned long virt, unsigned int pid) +{ + int i = 0; + for (i = 0; i < NUM_TLBCAMS; i++) { + if (tlbcam_addrs[i].start == virt) { + TLBCAM[i].MAS1 = 0; + loadcam_entry(i); + return; + } + } +} + unsigned long calc_cam_sz(unsigned long ram, unsigned long virt, phys_addr_t phys) { diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index dbbba8d..5880a74 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h @@ -94,6 +94,8 @@ extern void _tlbia(void); void settlbcam(int index, unsigned long virt, phys_addr_t phys, unsigned long size, unsigned long flags, unsigned int pid); +void cleartlbcam(unsigned long virt, unsigned int pid); + #ifdef CONFIG_PPC32 extern void mapin_ram(void); |