summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-08-31 19:31:09 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-20 17:56:44 -0400
commit2889093618a41a04d1a21af75a3d40834a6b1c47 (patch)
treec301a0cabf4f84cedc59b599b78a79de9b4d4abd /drivers
parentf361f89b12a7e2042a86ca2d183c4899bf181d9b (diff)
gpu: nvgpu: Add barriers for init test
Make sure that all writes have been commited before allowing the variable storing the init status to be seen as non-zero. Pair this with a read memory barrier where the check for the status is done. Bug 1799159 Change-Id: I938dffdfc2f39187b0dad11b7e283381560961b4 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1211523 (cherry picked from commit 6dd673d24a93c05834c9d96d2022b359ced5b73b) Reviewed-on: http://git-master/r/1223456 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
index 29f52081..2291a953 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_bitmap.c
@@ -42,6 +42,7 @@ static int gk20a_bitmap_alloc_inited(struct gk20a_allocator *a)
42{ 42{
43 struct gk20a_bitmap_allocator *ba = a->priv; 43 struct gk20a_bitmap_allocator *ba = a->priv;
44 44
45 rmb();
45 return ba->inited; 46 return ba->inited;
46} 47}
47 48
@@ -405,6 +406,7 @@ int gk20a_bitmap_allocator_init(struct gk20a_allocator *__a,
405 if (!a->bitmap) 406 if (!a->bitmap)
406 goto fail; 407 goto fail;
407 408
409 wmb();
408 a->inited = true; 410 a->inited = true;
409 411
410 gk20a_init_alloc_debug(__a); 412 gk20a_init_alloc_debug(__a);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
index 70a10c24..ee5e69d2 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
@@ -1078,6 +1078,7 @@ static int gk20a_buddy_alloc_inited(struct gk20a_allocator *a)
1078{ 1078{
1079 struct gk20a_buddy_allocator *ba = a->priv; 1079 struct gk20a_buddy_allocator *ba = a->priv;
1080 1080
1081 rmb();
1081 return ba->initialized; 1082 return ba->initialized;
1082} 1083}
1083 1084
@@ -1284,6 +1285,7 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1284 if (err) 1285 if (err)
1285 goto fail; 1286 goto fail;
1286 1287
1288 wmb();
1287 a->initialized = 1; 1289 a->initialized = 1;
1288 1290
1289 gk20a_init_alloc_debug(__a); 1291 gk20a_init_alloc_debug(__a);