drm/amdgpu: avoid force-completing uninitialized UVD rings
Subsystems (2)
PATCH v3 1/1 drm/amdgpu: avoid force-completing uninitialized UVD rings
uvd_v7_0_sw_init() does not initialize the UVD decode ring for an SR-IOV VF. However, amdgpu_uvd_resume() unconditionally force-completes the decode ring when restoring its fence sequence.
Skip fence completion when the fence driver is not initialized.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2 -1
@@ -517,7 +517,8 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) }memset_io (ptr,0 , size);/* to restore uvd fence seq */ -amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring,NULL ); +if (adev->uvd.inst[i].ring.fence_drv.initialized) +amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring,NULL ); } }return 0 ;
Signature · 1 line
2.34.1
AMD General
Quoted 42 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Bob Zhou
Sent: Wednesday, August 19, 2026 2:43 AM
To: [email protected]; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Min, Frank <[email protected]>
Cc: Zhou, Bob <[email protected]>
Subject: [PATCH v3] drm/amdgpu: avoid force-completing uninitialized UVD rings
uvd_v7_0_sw_init()does not initialize the UVD decode ring for an SR-IOV VF. However,amdgpu_uvd_resume()unconditionally force-completes the decode ring when restoring its fence sequence.Skip fence completion when the fence driver is not initialized.
Fixes 043f2271e2d0 ("drm/amdgpu: mark force completed fences with -ECANCELED")
Signed-off-by Bob Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +3
-2@@ -517,7 +517,8 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) }memset_io (ptr,0 , size);/* to restore uvd fence seq */ -amdgpu_fence_driver_force_completion (&adev- >uvd.inst[i].ring, NULL); +if (adev->uvd.inst[i].ring.fence_drv.initialized) +amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring, +NULL ); } }return 0 ; --2.34.1
AMD General
-----Original Message-----
From: Bob Zhou <[email protected]>
Sent: Wednesday, August 19, 2026 2:43 PM
To: [email protected]; Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Min, Frank <[email protected]>
Cc: Zhou, Bob <[email protected]>
Subject: [PATCH v3] drm/amdgpu: avoid force-completing uninitialized UVD rings
uvd_v7_0_sw_init() does not initialize the UVD decode ring for an SR-IOV VF. However, amdgpu_uvd_resume() unconditionally force-completes the decode ring when restoring its fence sequence.
Skip fence completion when the fence driver is not initialized.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +3 -1
@@ -517,7 +517,8 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) }memset_io (ptr,0 , size);/* to restore uvd fence seq */ -amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring,NULL ); +if (adev->uvd.inst[i].ring.fence_drv.initialized) +amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring, +NULL ); } }
return 0;
--
2.34.1
Christian König
maintainerQuoted 17 lines · Bob Zhou
uvd_v7_0_sw_init()does not initialize the UVD decode ring for an SR-IOV VF. However,amdgpu_uvd_resume()unconditionally force-completes the decode ring when restoring its fence sequence.Skip fence completion when the fence driver is not initialized.
Fixes 043f2271e2d0 ("drm/amdgpu: mark force completed fences with -ECANCELED")Signed-off-by Bob Zhou <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_resume(struct amdgpu_device *adev) · line 521
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +2
-1@@ -517,7 +517,8 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) }memset_io (ptr,0 , size);/* to restore uvd fence seq */ -amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring,NULL ); +if (adev->uvd.inst[i].ring.fence_drv.initialized) +amdgpu_fence_driver_force_completion (&adev->uvd.inst[i].ring,NULL );
That check should potentially be inside amdgpu_fence_driver_force_completion(), apart from that it looks good to me.
Regards,
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0} }return 0 ;