mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/amdgpu: refine codes to avoid reentering GPU recovery
if other threads have holden the reset lock, recovery will fail to try_lock. Therefore we introduce atomic hive->in_reset and adev->in_gpu_reset, to avoid reentering GPU recovery. v2: drop "? true : false" in the definition of amdgpu_in_reset Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Dennis Li <Dennis.Li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -1658,7 +1658,7 @@ static int dm_suspend(void *handle)
|
||||
struct amdgpu_display_manager *dm = &adev->dm;
|
||||
int ret = 0;
|
||||
|
||||
if (adev->in_gpu_reset) {
|
||||
if (amdgpu_in_reset(adev)) {
|
||||
mutex_lock(&dm->dc_lock);
|
||||
dm->cached_dc_state = dc_copy_state(dm->dc->current_state);
|
||||
|
||||
@@ -1844,7 +1844,7 @@ static int dm_resume(void *handle)
|
||||
struct dc_state *dc_state;
|
||||
int i, r, j;
|
||||
|
||||
if (adev->in_gpu_reset) {
|
||||
if (amdgpu_in_reset(adev)) {
|
||||
dc_state = dm->cached_dc_state;
|
||||
|
||||
r = dm_dmub_hw_init(adev);
|
||||
|
||||
Reference in New Issue
Block a user