summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-09-14 20:07:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-20 17:56:45 -0400
commitf5224bde147537f55cc0d6e90761471ab802cf19 (patch)
treeaa3b3acb037d489a3d158de1707389b5af0a4d33 /drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
parent9b7b5c3affdac7babeee111a2493baa90aace806 (diff)
gpu: nvgpu: Fix rmb()s in allocators
Fix the rmb() location of the rmb() in the buddy and bitmap allocators. The previous fix was not quite right. The rmb() needs to be after the init value is read so that any subsequent reads occur after the init value is read. If this is not done then subsequent reads could be loaded before the value of init is checked and possibly be invalid. Bug 1811382 Change-Id: I6d1fa25cc16c5e19fd2769d489878afa2f8e3e35 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1221061 (cherry picked from commit f2ddb6c56e554c39733c8fc9ae870dfc12e47b44) Reviewed-on: http://git-master/r/1223458 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
index ee5e69d2..f9fb48b5 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
@@ -1077,9 +1077,10 @@ static u64 gk20a_buddy_alloc_base(struct gk20a_allocator *a)
1077static int gk20a_buddy_alloc_inited(struct gk20a_allocator *a) 1077static 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 int inited = ba->initialized;
1080 1081
1081 rmb(); 1082 rmb();
1082 return ba->initialized; 1083 return inited;
1083} 1084}
1084 1085
1085static u64 gk20a_buddy_alloc_end(struct gk20a_allocator *a) 1086static u64 gk20a_buddy_alloc_end(struct gk20a_allocator *a)