Le 16/06/2026 à 16:41, Lazar, Lijo a écrit :
Public

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Pierre-Eric 
Pelloux-Prayer
Sent: Tuesday, June 16, 2026 6:21 PM
To: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; 
David Airlie <[email protected]>; Simona Vetter <[email protected]>; Pelloux-Prayer, Pierre-Eric 
<[email protected]>
Cc: [email protected]; [email protected]; 
[email protected]
Subject: [PATCH v1 2/2] drm/amdgpu: delay ttm buffer func enablement on xgmi

When amdgpu_init_minimal_xgmi is used, SDMA engines init is delayed so 
amdgpu_ttm_enable_buffer_funcs must be called later.

Without this, the check for num_buffer_funcs_scheds will fail and using ttm 
buffer funcs later will fail.

Fixes: 3a5da695c8d1 ("drm/amdgpu: only use working sdma schedulers for ttm")
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c   | 2 ++
  2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 57e10afb4714..2e8954fa5c40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2479,7 +2479,8 @@ static int amdgpu_device_ip_init(struct amdgpu_device 
*adev)
         if (r)
                 goto init_failed;

-       amdgpu_ttm_enable_buffer_funcs(adev);
+       if (amdgpu_ip_member_of_hwini(adev, AMD_IP_BLOCK_TYPE_SDMA))
+               amdgpu_ttm_enable_buffer_funcs(adev);

         /* Don't init kfd if whole hive need to be reset during init */
         if (adev->init_lvl->level != AMDGPU_INIT_LEVEL_MINIMAL_XGMI) { diff 
--git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index faac80a8a6eb..c0dca209335e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -1663,6 +1663,8 @@ static void amdgpu_xgmi_reset_on_init_work(struct 
work_struct *work)
                 if (r && r != -EHWPOISON)
                         dev_err(tmp_adev->dev,
                                 "error during bad page data initialization");
+
+               amdgpu_ttm_enable_buffer_funcs(tmp_adev);

<lijo> This gets enabled in the resume path after xgmi reset. It is not needed 
here.

Good point. I've modified the patch in v2.

Thanks,
Pierre-Eric



Thanks,
Lijo

         }
  }

--
2.43.0

Reply via email to