]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: gk20a: do not access invalid TLB
authorSang-Hun Lee <sanlee@nvidia.com>
Thu, 12 Jun 2014 17:52:59 +0000 (13:52 -0400)
committerEmad Mir <emir@nvidia.com>
Tue, 17 Jun 2014 22:18:38 +0000 (15:18 -0700)
Problem description:
 - gk20a_mm_tlb_invalidate guarantees callers that
   TLB would be in a clean state
 - gk20a_mm_tlb_invalidate checks whether the dirty
   flag is set, then mark clean, then performs
   reset operation
 - If there are two parallel callers, one thread would be
   performing the clean up operation, while the other thread
   is returned to the caller

Fix description:
 - Extends the duration of the TLB dirty flag mutex lock

Bug 1519537

Change-Id: Ib762d876ea11c06cc39399b1e2607ae3a2c0e17e
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/422820
(cherry picked from commit dc85d8f4fb08a2a7cc85f8432aee8370b860b73b)
Reviewed-on: http://git-master/r/423806
Reviewed-by: Emad Mir <emir@nvidia.com>
Tested-by: Emad Mir <emir@nvidia.com>
drivers/gpu/nvgpu/gk20a/mm_gk20a.c

index 5f70d0354662eb44e41ec0ac9ed2e985c3ef3935..6b428d41b44a853cf25b2e4aa3f4ba2acef42210 100644 (file)
@@ -2892,8 +2892,6 @@ void gk20a_mm_tlb_invalidate(struct vm_gk20a *vm)
                mutex_unlock(&vm->update_gmmu_lock);
                return;
        }
-       vm->tlb_dirty = false;
-       mutex_unlock(&vm->update_gmmu_lock);
 
        mutex_lock(&mm->tlb_lock);
        do {
@@ -2932,6 +2930,8 @@ void gk20a_mm_tlb_invalidate(struct vm_gk20a *vm)
                        "mmu invalidate too many retries");
 
        mutex_unlock(&mm->tlb_lock);
+       vm->tlb_dirty = false;
+       mutex_unlock(&vm->update_gmmu_lock);
 }
 
 int gk20a_mm_suspend(struct gk20a *g)