Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

James Zhu and committed by
Alex Deucher
4271bf11 210d1637

+2 -2
+2 -2
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
··· 187 187 static int jpeg_v2_5_hw_fini(void *handle) 188 188 { 189 189 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 190 - struct amdgpu_ring *ring; 191 190 int i; 191 + 192 + cancel_delayed_work_sync(&adev->vcn.idle_work); 192 193 193 194 for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) { 194 195 if (adev->jpeg.harvest_config & (1 << i)) 195 196 continue; 196 197 197 - ring = &adev->jpeg.inst[i].ring_dec; 198 198 if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && 199 199 RREG32_SOC15(JPEG, i, mmUVD_JRBC_STATUS)) 200 200 jpeg_v2_5_set_powergating_state(adev, AMD_PG_STATE_GATE);