drm/amdgpu: add codes to capture invalid hardware access when recovery
authorDennis Li <Dennis.Li@amd.com>
Wed, 10 Mar 2021 09:20:45 +0000 (17:20 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:34:53 +0000 (16:34 -0400)
commit56b53c0b5aa5de49747351b2ad323fd36089eb52
tree142d0d64ff22005bc80e515fc57a9e2371bb92f5
parentc103b850721e4a79ff9578f131888129c37a4679
drm/amdgpu: add codes to capture invalid hardware access when recovery

When recovery thread has begun GPU reset, there should be not other
threads to access hardware, otherwise system randomly hang.

v2 (chk): rewritten from scratch, use trylock and lockdep instead of
hand wiring the logic.

v3: add in_irq check

v4: change to check in_task

Signed-off-by: Dennis Li <Dennis.Li@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@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_gfx.c