drm/radeon: fix UVD suspend error
authorQiang Ma <maqianga@uniontech.com>
Mon, 17 Jan 2022 07:47:31 +0000 (15:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Jan 2022 22:43:36 +0000 (17:43 -0500)
commitdfd6879b98999867ac860a51348b00b5c0c2cafd
tree02c41950dc3dcf3c15e55ef51141b175c2b86a5f
parent4bd8dd0d61f961e6c13cc118d4ebbdba57f8561f
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: Leo Liu <leo.liu@amd.com>
Signed-off-by: Qiang Ma <maqianga@uniontech.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/si.c