All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Khatri, Sunil" <sukhatri@amd.com>
To: Mukul Joshi <mukul.joshi@amd.com>,
	amd-gfx@lists.freedesktop.org, "Koenig,
	Christian" <Christian.Koenig@amd.com>
Subject: Re: [PATCH v1 9/9] drm/amdgpu: use spm_vmid for the default RLC SPM VMID
Date: Tue, 29 Sep 2026 22:43:20 +0530	[thread overview]
Message-ID: <39db1027-cb18-498c-b93e-6d237263ecf2@amd.com> (raw)
In-Reply-To: <3233a346-d95f-49b4-9193-769e04493d8d@amd.com>


On 29-09-2026 08:26 pm, Mukul Joshi wrote:
>
>
> On 9/29/2026 8:04 AM, Christian König wrote:
>> 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).
>
> I don't see the full series for some reason so pointing it out here.
>
> We are reserving and using VMID 15 for NPA VMs currently on GFX 12.1.
>
> Currently, we are using it only on MMHUB. But this may change in the 
> future.
>
> So maybe refrain from using the same VMID 15.
>
@christian,
Whats you suggestion here on using the vmid15 suggestion that Mukul has 
shared.
>
> Also, since I can't see the full series, please look at 
> gmc_v12_0_sw_init() on how we are reserving the VMID.
>
I am not sure Mukul why you arent seeing the full series... I am aware 
of the NPA VMID 15 reservation in MMHUB and I will check have a look 
at  gmc_v12_0_sw_init.

Regards
Sunil Khatri

>
> Regards,
>
> Mukul
>
>
>> 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<sunil.khatri@amd.com>
>>> ---
>>>   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	other threads:[~2026-09-29 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260928185756.2382322-1-sunil.khatri@amd.com>
     [not found] ` <20260928185756.2382322-2-sunil.khatri@amd.com>
2026-09-29 11:48   ` [PATCH v1 2/9] drm/amdgpu: hand out the dedicated SPM VMID from the reserved path Christian König
2026-09-29 17:41     ` Khatri, Sunil
2026-09-29 11:54 ` [PATCH v1 1/9] drm/amdgpu: add spm_vmid and exclude it from the MES and KFD pools Christian König
2026-09-29 17:39   ` Khatri, Sunil
     [not found] ` <20260928185756.2382322-3-sunil.khatri@amd.com>
2026-09-29 11:59   ` [PATCH v1 3/9] drm/amdgpu: reserve SPM VMID on gfx7 Christian König
     [not found] ` <20260928185756.2382322-9-sunil.khatri@amd.com>
2026-09-29 12:04   ` [PATCH v1 9/9] drm/amdgpu: use spm_vmid for the default RLC SPM VMID Christian König
2026-09-29 14:56     ` Mukul Joshi
2026-09-29 17:13       ` Khatri, Sunil [this message]
2026-09-30  6:40         ` Christian König
2026-09-29 17:40     ` Khatri, Sunil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39db1027-cb18-498c-b93e-6d237263ecf2@amd.com \
    --to=sukhatri@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=mukul.joshi@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.