Skip to contentSkip to conversation

drm/amd/amdgpu: reserve vm invalidation engine for firmware

PATCH In review Jack Xiao 3 participants 4 messages Nov 17, 2022 – Nov 18, 2022

Subsystems (2)
lore
Share & tools
lore

Jack Xiao

author
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: reserve vm invalidation engine for firmware

If mes enabled, reserve VM invalidation engine 5 for firmware.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +6 -0
index 4365ede42855..e970e3760cec 100644
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
 	unsigned i;
 	unsigned vmhub, inv_eng;
 
+	if (adev->enable_mes) {
+		/* reserve engine 5 for firmware */
+		for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
+			vm_inv_engs[vmhub] &= ~(1 << 5);
+	}
+
 	for (i = 0; i < adev->num_rings; ++i) {
 		ring = adev->rings[i];
 		vmhub = ring->funcs->vmhub;
Signature · 1 line
2.37.3
maintainer
#1 lore raw

Am 17.11.22 um 10:11 schrieb Jack Xiao:

Quoted 12 lines

If mes enabled, reserve VM invalidation engine 5 for firmware.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
index 4365ede42855..e970e3760cec 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev) · line 487

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +6 -0
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
  	unsigned i;
  	unsigned vmhub, inv_eng;
 
+	if (adev->enable_mes) {
+		/* reserve engine 5 for firmware */
+		for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
+			vm_inv_engs[vmhub] &= ~(1 << 5);
+	}
+

Is that fixed and nailed down with the fw team? If yes the patch is rb by me.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
  	for (i = 0; i < adev->num_rings; ++i) {
  		ring = adev->rings[i];
  		vmhub = ring->funcs->vmhub;
#2 lore raw

[AMD Official Use Only - General]

This is fixed and requested by firmware team

Regards,
Hawking

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: Thursday, November 17, 2022 18:26
To: Xiao, Jack <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Pan, Xinhui <[email protected]>; Sider, Graham <[email protected]>
Subject: Re: [PATCH] drm/amd/amdgpu: reserve vm invalidation engine for firmware

Am 17.11.22 um 10:11 schrieb Jack Xiao:

Quoted 13 lines

If mes enabled, reserve VM invalidation engine 5 for firmware.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
index 4365ede42855..e970e3760cec 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev) · line 487

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +6 -0
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
  	unsigned i;
  	unsigned vmhub, inv_eng;
 
+	if (adev->enable_mes) {
+		/* reserve engine 5 for firmware */
+		for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
+			vm_inv_engs[vmhub] &= ~(1 << 5);
+	}
+

Is that fixed and nailed down with the fw team? If yes the patch is rb by me.

Regards,
Christian.

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0 -0
  	for (i = 0; i < adev->num_rings; ++i) {
  		ring = adev->rings[i];
  		vmhub = ring->funcs->vmhub;
Reviewed-by on v1 1/1
#3 lore raw
In reply to Jack Xiao

[AMD Official Use Only - General]

Regards,
Hawking
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Jack Xiao
Sent: Thursday, November 17, 2022 17:11
To: [email protected]; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>; Sider, Graham <[email protected]>
Cc: Xiao, Jack <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: reserve vm invalidation engine for firmware

If mes enabled, reserve VM invalidation engine 5 for firmware.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +6 -0
index 4365ede42855..e970e3760cec 100644
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
 	unsigned i;
 	unsigned vmhub, inv_eng;
 
+	if (adev->enable_mes) {
+		/* reserve engine 5 for firmware */
+		for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
+			vm_inv_engs[vmhub] &= ~(1 << 5);
+	}
+
 	for (i = 0; i < adev->num_rings; ++i) {
 		ring = adev->rings[i];
 		vmhub = ring->funcs->vmhub;
Signature · 1 line
2.37.3