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>
This commit is contained in:
Alex Waterman
2016-09-14 17:07:05 -07:00
committed by mobile promotions
parent 9b7b5c3aff
commit f5224bde14
2 changed files with 4 additions and 2 deletions

View File

@@ -41,9 +41,10 @@ static u64 gk20a_bitmap_alloc_base(struct gk20a_allocator *a)
static int gk20a_bitmap_alloc_inited(struct gk20a_allocator *a)
{
struct gk20a_bitmap_allocator *ba = a->priv;
int inited = ba->inited;
rmb();
return ba->inited;
return inited;
}
static u64 gk20a_bitmap_alloc_end(struct gk20a_allocator *a)