Commit dfd6879b authored by Qiang Ma's avatar Qiang Ma Committed by Alex Deucher
Browse files

drm/radeon: fix UVD suspend error



I met a bug recently and the kernel log:

[  330.171875] radeon 0000:03:00.0: couldn't schedule ib
[  330.175781] [drm:radeon_uvd_suspend [radeon]] *ERROR* Error destroying UVD (-22)!

In radeon drivers, using UVD suspend is as follows:

if (rdev->has_uvd) {
        uvd_v1_0_fini(rdev);
        radeon_uvd_suspend(rdev);
}

In radeon_ib_schedule function, we check the 'ring->ready' state,
but in uvd_v1_0_fini funciton, we've cleared the ready state.
So, just modify the suspend code flow to fix error.

Reviewed-by: default avatarLeo Liu <leo.liu@amd.com>
Signed-off-by: default avatarQiang Ma <maqianga@uniontech.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4bd8dd0d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8517,8 +8517,8 @@ int cik_suspend(struct radeon_device *rdev)
	cik_cp_enable(rdev, false);
	cik_sdma_enable(rdev, false);
	if (rdev->has_uvd) {
		uvd_v1_0_fini(rdev);
		radeon_uvd_suspend(rdev);
		uvd_v1_0_fini(rdev);
	}
	if (rdev->has_vce)
		radeon_vce_suspend(rdev);
+1 −1
Original line number Diff line number Diff line
@@ -5156,8 +5156,8 @@ int evergreen_suspend(struct radeon_device *rdev)
	radeon_pm_suspend(rdev);
	radeon_audio_fini(rdev);
	if (rdev->has_uvd) {
		uvd_v1_0_fini(rdev);
		radeon_uvd_suspend(rdev);
		uvd_v1_0_fini(rdev);
	}
	r700_cp_stop(rdev);
	r600_dma_stop(rdev);
+1 −1
Original line number Diff line number Diff line
@@ -2323,8 +2323,8 @@ int cayman_suspend(struct radeon_device *rdev)
	cayman_cp_enable(rdev, false);
	cayman_dma_stop(rdev);
	if (rdev->has_uvd) {
		uvd_v1_0_fini(rdev);
		radeon_uvd_suspend(rdev);
		uvd_v1_0_fini(rdev);
	}
	evergreen_irq_suspend(rdev);
	radeon_wb_disable(rdev);
+1 −1
Original line number Diff line number Diff line
@@ -3232,8 +3232,8 @@ int r600_suspend(struct radeon_device *rdev)
	radeon_audio_fini(rdev);
	r600_cp_stop(rdev);
	if (rdev->has_uvd) {
		uvd_v1_0_fini(rdev);
		radeon_uvd_suspend(rdev);
		uvd_v1_0_fini(rdev);
	}
	r600_irq_suspend(rdev);
	radeon_wb_disable(rdev);
+1 −1
Original line number Diff line number Diff line
@@ -1894,8 +1894,8 @@ int rv770_suspend(struct radeon_device *rdev)
	radeon_pm_suspend(rdev);
	radeon_audio_fini(rdev);
	if (rdev->has_uvd) {
		uvd_v1_0_fini(rdev);
		radeon_uvd_suspend(rdev);
		uvd_v1_0_fini(rdev);
	}
	r700_cp_stop(rdev);
	r600_dma_stop(rdev);
Loading