Re: [PATCH v2 3/3] drm/amdgpu: remove useless enable/disable of ttm buffer funcs

Alex Deucher <[email protected]> Tue, 4 Aug 2026 11:36:21 -0400
Newsgroups gmane.comp.freedesktop.amd-gfx,gmane.comp.video.dri.devel,gmane.linux.kernel
Message-ID <CADnq5_M+-sADczApmUUBtYXWpo97EXEcxZGApCiDeT1wU+4gBQ@mail.gmail.com>
On Wed, Jun 17, 2026 at 9:39=E2=80=AFAM Pierre-Eric Pelloux-Prayer
<[email protected]> wrote:
>
> amdgpu_ttm_disable_buffer_funcs and amdgpu_ttm_enable_buffer_funcs should
> each only be called once per amdgpu_device: at startup and teardown.
>
> Therefore the other calls are redundant and can be safely dropped.

I think there were originally issues where SDMA was attempted to be
used when it was not ready which is why we added all of these cases,
but I think that should be handled properly now.  Series is:
Reviewed-by: Alex Deucher <[email protected]>

>
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd=
.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 -----
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    | 1 -
>  2 files changed, 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm=
/amd/amdgpu/amdgpu_device.c
> index 53150fe55350..6abcde8a1a00 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3381,8 +3381,6 @@ static int amdgpu_device_ip_resume(struct amdgpu_de=
vice *adev)
>
>         r =3D amdgpu_device_ip_resume_phase2(adev);
>
> -       amdgpu_ttm_enable_buffer_funcs(adev);
> -
>         if (r)
>                 return r;
>
> @@ -4505,8 +4503,6 @@ int amdgpu_device_suspend(struct drm_device *dev, b=
ool notify_clients)
>         if (r)
>                 goto unwind_userq;
>
> -       amdgpu_ttm_disable_buffer_funcs(adev);
> -
>         amdgpu_fence_driver_hw_fini(adev);
>
>         r =3D amdgpu_device_ip_suspend_phase2(adev);
> @@ -4519,7 +4515,6 @@ int amdgpu_device_suspend(struct drm_device *dev, b=
ool notify_clients)
>         return 0;
>
>  unwind_evict:
> -       amdgpu_ttm_enable_buffer_funcs(adev);
>         amdgpu_fence_driver_hw_init(adev);
>
>  unwind_userq:
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/am=
d/amdgpu/amdgpu_ttm.c
> index 6c6ab4dd6ea9..95f879e723ea 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2099,7 +2099,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
>         }
>
>         /* Change the size here instead of the init above so only lpfn is=
 affected */
> -       amdgpu_ttm_disable_buffer_funcs(adev);
>  #ifdef CONFIG_64BIT
>  #ifdef CONFIG_X86
>         if (adev->gmc.xgmi.connected_to_cpu)
> --
> 2.43.0
>