[PATCH 3/3] drm/amdgpu/vcn: Ensure that sysfs reset run in the fini

Alex Deucher alexdeucher at gmail.com
Mon Aug 18 15:12:14 UTC 2025


On Sat, Aug 16, 2025 at 12:28 PM Rodrigo Siqueira <siqueira at igalia.com> wrote:
>
> The function amdgpu_vcn_sysfs_reset_mask_fini() in the
> vcn_v5_0_1_sw_fini() is invoked at the end of the function, after
> amdgpu_vcn_sw_fini(). This can be a problem if amdgpu_vcn_sw_fini()
> returns early, since the VCN reset sysfs interface will not be removed.
> This commit addresses the issue by moving
> amdgpu_vcn_sysfs_reset_mask_fini() above amdgpu_vcn_sw_fini(), aligning
> the fini code with vcn_v4_0_3_sw_fini().
>
> Signed-off-by: Rodrigo Siqueira <siqueira at igalia.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
> index 7cb21e2b4eb0..3b7372861032 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
> @@ -245,14 +245,14 @@ static int vcn_v5_0_1_sw_fini(struct amdgpu_ip_block *ip_block)
>                         return r;
>         }
>
> +       amdgpu_vcn_sysfs_reset_mask_fini(adev);
> +
>         for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
>                 r = amdgpu_vcn_sw_fini(adev, i);

This function always returns success.  I'd suggested changing it to a
void and dropping the early return.

Alex

>                 if (r)
>                         return r;
>         }
>
> -       amdgpu_vcn_sysfs_reset_mask_fini(adev);
> -
>         return 0;
>  }
>
> --
> 2.47.2
>


More information about the amd-gfx mailing list