diff options
author | James Zhu <[email protected]> | 2021-05-19 11:42:48 -0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2021-05-20 17:04:17 -0400 |
commit | ff48f6dbf0ff896c98d167a67a5b975fb034356b (patch) | |
tree | 23dca0c36a442de42f6f6f6a3b81f5b9eaa895e3 | |
parent | 4a62542ae064e3b645d6bbf2295a6c05136956c6 (diff) |
drm/amdgpu/jpeg2.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/jpeg_v2_0.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c index de5abceced0d..85967a5570cb 100644 --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c @@ -172,6 +172,8 @@ static int jpeg_v2_0_hw_fini(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + cancel_delayed_work_sync(&adev->vcn.idle_work); + if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS)) jpeg_v2_0_set_powergating_state(adev, AMD_PG_STATE_GATE); |