diff options
author | James Zhu <[email protected]> | 2021-05-19 11:26:32 -0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2021-05-20 17:03:10 -0400 |
commit | 0c6013377b4027e69d8f3e63b6bf556b6cb87802 (patch) | |
tree | d580e642a5eff1ce202ac92b118e31e866ab240d | |
parent | b95f045ea35673572ef46d6483ad8bd6d353d63c (diff) |
drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate
Add cancel_delayed_work_sync before set power gating state
to avoid race condition issue when power gating.
Signed-off-by: James Zhu <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c index 116b9643d5ba..8af567c546db 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c @@ -262,6 +262,8 @@ static int vcn_v2_0_hw_fini(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + cancel_delayed_work_sync(&adev->vcn.idle_work); + if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) || (adev->vcn.cur_state != AMD_PG_STATE_GATE && RREG32_SOC15(VCN, 0, mmUVD_STATUS))) |