Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/amdgpu: undefined guard in
  amdgpu_acpi_find_gpu_memory_in_srat() [1]
--

commit d687d56267f159cb114f4a53091a5e9a32dc7973
Author: Zhigang Luo <[email protected]>

Revert "drm/amdgpu: take the A+A VF GMC aperture from SRAT"

This commit reverts the direct SRAT aperture lookup in gmc_v12_0_early_init()
and the SPM overrides in gmc_v12_0_vram_gtt_location(), gmc_v12_0_mc_init(),
and mmhub_v4_2_0_get_xgmi_info() so that the GMC aperture is derived from the
FB offset and XGMI node segment size instead.

> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> index cd276a138e101..7e0b83b1015fc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
> @@ -639,7 +639,6 @@ static void gmc_v12_0_set_gfxhub_funcs(struct 
> amdgpu_device *adev)
>  static int gmc_v12_0_early_init(struct amdgpu_ip_block *ip_block)
>  {
>       struct amdgpu_device *adev = ip_block->adev;
> -     int r;
>  
>       if (adev->smuio.funcs &&
>           adev->smuio.funcs->is_host_gpu_xgmi_supported)
> @@ -662,18 +661,6 @@ static int gmc_v12_0_early_init(struct amdgpu_ip_block 
> *ip_block)
>       gmc_v12_0_set_mmhub_funcs(adev);
>       gmc_v12_0_set_umc_funcs(adev);
>  
> -     if (amdgpu_virt_vram_is_spm(adev)) {
> -             u64 aper_base, aper_size;
> -
> -             r = amdgpu_acpi_find_gpu_memory_in_srat(adev, &aper_base,
> -                                                     &aper_size);
> -             if (r)
> -                     return r;
> -
> -             adev->gmc.aper_base = aper_base;
> -             adev->gmc.aper_size = aper_size;
> -     }

[Severity: High]
This problem wasn't introduced by this patch, but does
amdgpu_acpi_find_gpu_memory_in_srat() [1] always return -ENOENT?

In drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c, the SRAT lookup implementation
is guarded by #ifdef HAVE_ACPI_SRAT_GENERIC_AFFINITY, an out-of-tree autoconf
macro that is never defined in the kernel tree even though struct
acpi_srat_generic_affinity is unconditionally defined in
include/acpi/actbl3.h.  Only the #else fallback stub is compiled, causing
SRAT lookups for SPM-backed VRAM to fail with -ENOENT during device probe.

[1] https://sashiko.dev/#/bug/linux-e20f9f1a-d616-45e0-9734-058df15f4c59

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

Reply via email to