Skip to content

Commit 20ebbfd

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdgpu/jpeg3: 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]
1 parent 23f10a5 commit 20ebbfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ static int jpeg_v3_0_hw_init(void *handle)
159159
static int jpeg_v3_0_hw_fini(void *handle)
160160
{
161161
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
162-
struct amdgpu_ring *ring;
163162

164-
ring = &adev->jpeg.inst->ring_dec;
163+
cancel_delayed_work_sync(&adev->vcn.idle_work);
164+
165165
if (adev->jpeg.cur_state != AMD_PG_STATE_GATE &&
166166
RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS))
167167
jpeg_v3_0_set_powergating_state(adev, AMD_PG_STATE_GATE);

0 commit comments

Comments
 (0)