On 9/28/26 20:57, Sunil Khatri wrote:
> The RLC bring-up paths programmed the RLC_SPM_VMID field to a hardcoded
> 0xf as the idle default. Now that the dedicated SPM VMID is tracked in
> vm_manager.spm_vmid, use it directly so the idle default matches the
> VMID the reservation path hands out.
> 
> No functional change: spm_vmid is the top VMID (0xf) on all affected
> generations (gfx7 through gfx12).

You also need to remove all the calls to adev->gfx.rlc.funcs->update_spm_vmid 
from amdgpu_vm_flush() and amdgpu_ib_schedule().

Regards,
Christian.

> 
> Signed-off-by: Sunil Khatri <[email protected]>
> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +-
>  8 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index 33403e16df5ca..88f9f0b0bf524 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -5583,7 +5583,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device 
> *adev)
>  
>               gfx_v10_0_init_csb(adev);
>  
> -             gfx_v10_0_update_spm_vmid_internal(adev, 0xf);
> +             gfx_v10_0_update_spm_vmid_internal(adev, 
> adev->vm_manager.spm_vmid);
>  
>               if (!amdgpu_sriov_vf(adev)) /* enable RLC SRM */
>                       gfx_v10_0_rlc_enable_srm(adev);
> @@ -5615,7 +5615,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device 
> *adev)
>  
>               gfx_v10_0_init_csb(adev);
>  
> -             gfx_v10_0_update_spm_vmid_internal(adev, 0xf);
> +             gfx_v10_0_update_spm_vmid_internal(adev, 
> adev->vm_manager.spm_vmid);
>  
>               adev->gfx.rlc.funcs->start(adev);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 7bfc8cbdcad85..036d1b7ade4e6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -944,7 +944,7 @@ static int gfx_v11_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> index b75512e7b1db6..4caa43ff50a1b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> @@ -773,7 +773,7 @@ static int gfx_v12_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> index 91764f2e5ad01..a3d72cbaa6cf1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> @@ -1848,7 +1848,7 @@ static int gfx_v12_1_xcc_rlc_resume(struct 
> amdgpu_device *adev,
>       int r;
>  
>       /* init spm vmid with 0xf */
> -     gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, 0xf);
> +     gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
>               gfx_v12_1_xcc_init_csb(adev, xcc_id);
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index 549d1239e326b..04ee7e1725a94 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -3252,7 +3252,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index ab4123ddbb942..61ba71b57b8e2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -1274,7 +1274,7 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 1678015ce5a97..4862d17a58237 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -3240,7 +3240,7 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device 
> *adev)
>               break;
>       }
>  
> -     gfx_v9_0_update_spm_vmid_internal(adev, 0xf);
> +     gfx_v9_0_update_spm_vmid_internal(adev, adev->vm_manager.spm_vmid);
>  
>       adev->gfx.rlc.funcs->start(adev);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 01ed1701c781a..add8099cf8e05 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1395,7 +1395,7 @@ static int gfx_v9_4_3_rlc_init(struct amdgpu_device 
> *adev)
>  {
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }

Reply via email to