Skip to content

Commit 23f10a5

Browse files
jameszhu-amdalexdeucher
authored andcommitted
drm/amdgpu/jpeg2.5: 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 ff48f6d commit 23f10a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,14 @@ static int jpeg_v2_5_hw_init(void *handle)
187187
static int jpeg_v2_5_hw_fini(void *handle)
188188
{
189189
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
190-
struct amdgpu_ring *ring;
191190
int i;
192191

192+
cancel_delayed_work_sync(&adev->vcn.idle_work);
193+
193194
for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
194195
if (adev->jpeg.harvest_config & (1 << i))
195196
continue;
196197

197-
ring = &adev->jpeg.inst[i].ring_dec;
198198
if (adev->jpeg.cur_state != AMD_PG_STATE_GATE &&
199199
RREG32_SOC15(JPEG, i, mmUVD_JRBC_STATUS))
200200
jpeg_v2_5_set_powergating_state(adev, AMD_PG_STATE_GATE);

0 commit comments

Comments
 (0)