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/common/mm/lockless_allocator.c | |
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/common/mm/lockless_allocator.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/lockless_allocator.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c index eeb86095..8f712a14 100644 --- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <nvgpu/atomic.h> | 17 | #include <nvgpu/atomic.h> |
18 | #include <nvgpu/allocator.h> | 18 | #include <nvgpu/allocator.h> |
19 | #include <nvgpu/kmem.h> | 19 | #include <nvgpu/kmem.h> |
20 | #include <nvgpu/barrier.h> | ||
20 | 21 | ||
21 | #include "lockless_allocator_priv.h" | 22 | #include "lockless_allocator_priv.h" |
22 | 23 | ||
@@ -39,7 +40,7 @@ static int nvgpu_lockless_alloc_inited(struct nvgpu_allocator *a) | |||
39 | struct nvgpu_lockless_allocator *pa = a->priv; | 40 | struct nvgpu_lockless_allocator *pa = a->priv; |
40 | int inited = pa->inited; | 41 | int inited = pa->inited; |
41 | 42 | ||
42 | rmb(); | 43 | nvgpu_smp_rmb(); |
43 | return inited; | 44 | return inited; |
44 | } | 45 | } |
45 | 46 | ||
@@ -198,7 +199,7 @@ int nvgpu_lockless_allocator_init(struct gk20a *g, struct nvgpu_allocator *__a, | |||
198 | a->flags = flags; | 199 | a->flags = flags; |
199 | nvgpu_atomic_set(&a->nr_allocs, 0); | 200 | nvgpu_atomic_set(&a->nr_allocs, 0); |
200 | 201 | ||
201 | wmb(); | 202 | nvgpu_smp_wmb(); |
202 | a->inited = true; | 203 | a->inited = true; |
203 | 204 | ||
204 | #ifdef CONFIG_DEBUG_FS | 205 | #ifdef CONFIG_DEBUG_FS |