drm/amdgpu: fix user fence write race condition
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 29 Jun 2018 11:23:25 +0000 (13:23 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 Jul 2018 21:39:57 +0000 (16:39 -0500)
commit9fc15f5fc836712b173f04e143b8d77fdded1a37
treefb3b276b6668f04e491a6f3faf196555bf843f12
parent860c15e903327f9af269d2ee7011454624dfcb90
drm/amdgpu: fix user fence write race condition

The buffer object backing the user fence is reserved using the non-user
fence, i.e., as soon as the non-user fence is signaled, the user fence
buffer object can be moved or even destroyed.

Therefore, emit the user fence first.

Both fences have the same cache invalidation behavior, so this should
have no user-visible effect.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c