From 81868a187fa3b217368206f17b19309846e8e7fb Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Fri, 18 Aug 2017 16:22:29 +0530 Subject: gpu: nvgpu: Nvgpu abstraction for linux barriers. construct wrapper nvgpu_* methods to replace mb,rmb,wmb,smp_mb,smp_rmb,smp_wmb,read_barrier_depends and smp_read_barrier_depends. NVGPU-122 Change-Id: I8d24dd70fef5cb0fadaacc15f3ab11531667a0df Signed-off-by: Debarshi Reviewed-on: https://git-master.nvidia.com/r/1541199 Reviewed-by: svccoveritychecker Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Sourab Gupta Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/common/mm/gmmu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c') diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 73dff2c3..7f486d68 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "gk20a/gk20a.h" #include "gk20a/mm_gk20a.h" @@ -164,8 +165,8 @@ int nvgpu_gmmu_init_page_table(struct vm_gk20a *vm) return err; /* - * One mb() is done after all mapping operations. Don't need individual - * barriers for each PD write. + * One nvgpu_smp_mb() is done after all mapping operations. Don't need + * individual barriers for each PD write. */ vm->pdb.mem->skip_wmb = true; @@ -259,8 +260,8 @@ static int pd_allocate(struct vm_gk20a *vm, } /* - * One mb() is done after all mapping operations. Don't need individual - * barriers for each PD write. + * One nvgpu_smp_mb() is done after all mapping operations. Don't need + * individual barriers for each PD write. */ pd->mem->skip_wmb = true; @@ -714,7 +715,7 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm, attrs); unmap_gmmu_pages(g, &vm->pdb); - mb(); + nvgpu_smp_mb(); __gmmu_dbg(g, attrs, "%-5s Done!", sgt ? "MAP" : "UNMAP"); @@ -983,7 +984,7 @@ int __nvgpu_set_pte(struct gk20a *g, struct vm_gk20a *vm, u64 vaddr, u32 *pte) * There probably also needs to be a TLB invalidate as well but we leave * that to the caller of this function. */ - wmb(); + nvgpu_smp_wmb(); return 0; } -- cgit v1.2.2