Skip to contentSkip to conversation

drm/amd: Fix unbind/rebind for VCN 4.0.5

PATCH In review Mario Limonciello (AMD) 2 participants 2 messages Dec 9, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd: Fix unbind/rebind for VCN 4.0.5

Unbinding amdgpu has no problems, but binding it again leads to an error of sysfs file already existing. This is because it wasn't actually cleaned up on unbind. Add the missing cleanup step.

Fixes 547aad32edac1 ("drm/amdgpu: add VCN4 ip block support")
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +2 -0
index b107ee80e4728..1f6a22983c0dd 100644
@@ -265,6 +265,8 @@ static int vcn_v4_0_5_sw_fini(struct amdgpu_ip_block *ip_block)
 	if (amdgpu_sriov_vf(adev))
 		amdgpu_virt_free_mm_table(adev);
 
+	amdgpu_vcn_sysfs_reset_mask_fini(adev);
+
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
 		r = amdgpu_vcn_suspend(adev, i);
 		if (r)
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mario Limonciello (AMD)

Unbinding amdgpu has no problems, but binding it again leads to an error of sysfs file already existing. This is because it wasn't actually cleaned up on unbind. Add the missing cleanup step.

Fixes 547aad32edac1 ("drm/amdgpu: add VCN4 ip block support")
Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +2 -1
index b107ee80e4728..1f6a22983c0dd 100644
@@ -265,6 +265,8 @@ static int vcn_v4_0_5_sw_fini(struct amdgpu_ip_block *ip_block)
        if (amdgpu_sriov_vf(adev))
                amdgpu_virt_free_mm_table(adev);
 
+       amdgpu_vcn_sysfs_reset_mask_fini(adev);
+
        for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
                r = amdgpu_vcn_suspend(adev, i);
                if (r)
--

2.43.0