Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:

Pre-existing issues:
- [High] The relocated call to amdgpu_ttm_enable_buffer_funcs() silently fails 
due to the amdgpu_in_reset() guard, leaving TTM DMA permanently disabled.
--

commit 61a1713a716e72510eef36a97d31d040637c47f6
Author: Pierre-Eric Pelloux-Prayer <[email protected]>

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. This commit moves
the call into amdgpu_device_reinit_after_reset to avoid initialization
failures.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 57e10afb4714d..53150fe553508 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
[ ... ]
> @@ -5320,6 +5319,8 @@ int amdgpu_device_reinit_after_reset(struct 
> amdgpu_reset_context *reset_context)
>                               r = -EAGAIN;
>                               goto end;
>                       }
> +
> +                     amdgpu_ttm_enable_buffer_funcs(tmp_adev);

[Severity: High]
This isn't a bug introduced by this patch, but doesn't this relocated call
silently fail due to the amdgpu_in_reset() guard?

Because amdgpu_device_reinit_after_reset() executes within a hardware reset
context, the in_gpu_reset flag is set. Looking at
amdgpu_ttm_enable_buffer_funcs() in drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c,
there is an early return guard for this:

        if (!adev->mman.initialized || amdgpu_in_reset(adev) ||
            adev->mman.buffer_funcs_enabled || adev->gmc.is_app_apu)
                return;

Will this cause the function to silently abort, leaving TTM DMA permanently
disabled and forcing all VRAM migrations to fallback to slow CPU copies?

Also, by placing the call at the very end of amdgpu_device_reinit_after_reset(),
it executes after drm_client_dev_resume(). Would any VRAM migrations triggered
by fbdev restore run without hardware DMA even if the early return was bypassed?

>               }
>  
>               if (r)

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to