summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/lockless_allocator.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/lockless_allocator.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
index 04df7e3f..0df1ae9d 100644
--- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c
@@ -60,9 +60,9 @@ static u64 nvgpu_lockless_alloc(struct nvgpu_allocator *a, u64 len)
60 if (len != pa->blk_size) 60 if (len != pa->blk_size)
61 return 0; 61 return 0;
62 62
63 head = ACCESS_ONCE(pa->head); 63 head = NV_ACCESS_ONCE(pa->head);
64 while (head >= 0) { 64 while (head >= 0) {
65 new_head = ACCESS_ONCE(pa->next[head]); 65 new_head = NV_ACCESS_ONCE(pa->next[head]);
66 ret = cmpxchg(&pa->head, head, new_head); 66 ret = cmpxchg(&pa->head, head, new_head);
67 if (ret == head) { 67 if (ret == head) {
68 addr = pa->base + head * pa->blk_size; 68 addr = pa->base + head * pa->blk_size;
@@ -71,7 +71,7 @@ static u64 nvgpu_lockless_alloc(struct nvgpu_allocator *a, u64 len)
71 addr); 71 addr);
72 break; 72 break;
73 } 73 }
74 head = ACCESS_ONCE(pa->head); 74 head = NV_ACCESS_ONCE(pa->head);
75 } 75 }
76 76
77 if (addr) 77 if (addr)
@@ -93,8 +93,8 @@ static void nvgpu_lockless_free(struct nvgpu_allocator *a, u64 addr)
93 alloc_dbg(a, "Free node # %llu @ addr 0x%llx\n", cur_idx, addr); 93 alloc_dbg(a, "Free node # %llu @ addr 0x%llx\n", cur_idx, addr);
94 94
95 while (1) { 95 while (1) {
96 head = ACCESS_ONCE(pa->head); 96 head = NV_ACCESS_ONCE(pa->head);
97 ACCESS_ONCE(pa->next[cur_idx]) = head; 97 NV_ACCESS_ONCE(pa->next[cur_idx]) = head;
98 ret = cmpxchg(&pa->head, head, cur_idx); 98 ret = cmpxchg(&pa->head, head, cur_idx);
99 if (ret == head) { 99 if (ret == head) {
100 nvgpu_atomic_dec(&pa->nr_allocs); 100 nvgpu_atomic_dec(&pa->nr_allocs);