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>
Wed, 4 Jul 2018 07:40:18 +0000 (02:40 -0500)
commitc660f40b711980b42d8beac4b395a10645b20d5d
tree75cef41fd299770b8249a77be935dcc62a14aeeb
parentc3d0280be8d5c6de9e3848e280493f561799bb67
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>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c