drm/amdgpu: fix a race in GPU reset with IB test (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 28 May 2019 19:17:25 +0000 (14:17 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Jun 2019 03:18:09 +0000 (22:18 -0500)
commitbeff74bc6e0fa910454fecb3fdc3843b1bfdafb9
tree1cb8bd2320c07fdae0fd9f5034524d44d9ee4cb5
parentc53e4db71276bf257b09010935a04bdafddd458e
drm/amdgpu: fix a race in GPU reset with IB test (v2)

Split late_init into two functions, one (do_late_init) which
just does the hw init, and late_init which calls do_late_init
and schedules the IB test work.  Call do_late_init in
the GPU reset code to run the init code, but not schedule
the IB test code.  The IB test code is called directly
in the gpu reset code so no need to run the IB tests
in a separate work thread.  If we do, we end up racing.

v2: Rework late_init.  Pull out the mgpu fan boost and xgmi
pstate code into late_init so they get called in all cases.
rename the late_init worker thread to delayed work since it's
just the IB tests now which can happen later.  Schedule the
work at init and resume time.  It's not needed at reset time
because the IB tests are called directly.

Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: Xinhui Pan <xinhui.pan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c