diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-08-18 06:52:29 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-22 06:53:51 -0400 |
commit | 81868a187fa3b217368206f17b19309846e8e7fb (patch) | |
tree | 2b59e33b61cc6e206f7781f3b4ab44c5c7b6d721 /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | 5f010177de985c901c33c914efe70a8498a5974f (diff) |
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 <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1541199
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 19ea76cb..ab2d0b7f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -49,6 +49,7 @@ struct nvgpu_cpu_time_correlation_sample; | |||
49 | #include <nvgpu/falcon.h> | 49 | #include <nvgpu/falcon.h> |
50 | #include <nvgpu/pmu.h> | 50 | #include <nvgpu/pmu.h> |
51 | #include <nvgpu/atomic.h> | 51 | #include <nvgpu/atomic.h> |
52 | #include <nvgpu/barrier.h> | ||
52 | 53 | ||
53 | #include "clk_gk20a.h" | 54 | #include "clk_gk20a.h" |
54 | #include "ce2_gk20a.h" | 55 | #include "ce2_gk20a.h" |
@@ -1324,7 +1325,7 @@ static inline void gk20a_writel(struct gk20a *g, u32 r, u32 v) | |||
1324 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); | 1325 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); |
1325 | } else { | 1326 | } else { |
1326 | writel_relaxed(v, g->regs + r); | 1327 | writel_relaxed(v, g->regs + r); |
1327 | wmb(); | 1328 | nvgpu_smp_wmb(); |
1328 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x", r, v); | 1329 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x", r, v); |
1329 | } | 1330 | } |
1330 | } | 1331 | } |
@@ -1351,7 +1352,7 @@ static inline void gk20a_writel_check(struct gk20a *g, u32 r, u32 v) | |||
1351 | __gk20a_warn_on_no_regs(); | 1352 | __gk20a_warn_on_no_regs(); |
1352 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); | 1353 | gk20a_dbg(gpu_dbg_reg, "r=0x%x v=0x%x (failed)", r, v); |
1353 | } else { | 1354 | } else { |
1354 | wmb(); | 1355 | nvgpu_smp_wmb(); |
1355 | do { | 1356 | do { |
1356 | writel_relaxed(v, g->regs + r); | 1357 | writel_relaxed(v, g->regs + r); |
1357 | } while (readl(g->regs + r) != v); | 1358 | } while (readl(g->regs + r) != v); |
@@ -1365,7 +1366,7 @@ static inline void gk20a_bar1_writel(struct gk20a *g, u32 b, u32 v) | |||
1365 | __gk20a_warn_on_no_regs(); | 1366 | __gk20a_warn_on_no_regs(); |
1366 | gk20a_dbg(gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v); | 1367 | gk20a_dbg(gpu_dbg_reg, "b=0x%x v=0x%x (failed)", b, v); |
1367 | } else { | 1368 | } else { |
1368 | wmb(); | 1369 | nvgpu_smp_wmb(); |
1369 | writel_relaxed(v, g->bar1 + b); | 1370 | writel_relaxed(v, g->bar1 + b); |
1370 | gk20a_dbg(gpu_dbg_reg, "b=0x%x v=0x%x", b, v); | 1371 | gk20a_dbg(gpu_dbg_reg, "b=0x%x v=0x%x", b, v); |
1371 | } | 1372 | } |