drm/amdkfd: fix cp hang in eviction
authorEric Huang <JinhuiEric.Huang@amd.com>
Tue, 9 Jul 2019 19:33:53 +0000 (15:33 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 11 Jul 2019 19:37:24 +0000 (14:37 -0500)
commit70df8273ca0cebd2bba443a4444b4944a5929151
treeaba0381400e3b31c1b7d2c73fab6d376e38810c2
parent63e2fef631383b9a44a2b727b9507fe058cba9c1
drm/amdkfd: fix cp hang in eviction

The cp hang occurs in OCL conformance test only on supermicro
platform which has 40 cores and the test generates 40 threads.
The root cause is race condition in non-protected flags.

The fix is to add flags of is_evicted and is_active(init_mqd())
into protected area.

Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c