mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
drm/amdgpu/jpeg: Hold pg_lock before jpeg poweroff
[ Upstream commit 0e7581eda8 ]
Acquire jpeg_pg_lock before changes to jpeg power state
and release it after power off from idle work handler.
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bfe6e7a2a8
commit
5edea8416e
@@ -121,10 +121,12 @@ static void amdgpu_jpeg_idle_work_handler(struct work_struct *work)
|
||||
fences += amdgpu_fence_count_emitted(&adev->jpeg.inst[i].ring_dec[j]);
|
||||
}
|
||||
|
||||
if (!fences && !atomic_read(&adev->jpeg.total_submission_cnt))
|
||||
if (!fences && !atomic_read(&adev->jpeg.total_submission_cnt)) {
|
||||
mutex_lock(&adev->jpeg.jpeg_pg_lock);
|
||||
amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_JPEG,
|
||||
AMD_PG_STATE_GATE);
|
||||
else
|
||||
mutex_unlock(&adev->jpeg.jpeg_pg_lock);
|
||||
} else
|
||||
schedule_delayed_work(&adev->jpeg.idle_work, JPEG_IDLE_TIMEOUT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user