Skip to contentSkip to conversation

drm/amdgpu: Improve Vega10 VM fault handling

PATCH In review Felix Kuehling 4 participants 9 messages Mar 27, 2017 – Mar 29, 2017 6 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Improve Vega10 VM fault handling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +13 -6
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
 		WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
 	}
 
-	DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
-		  "at page 0x%016llx from %d\n"
-		  "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-		  entry->vm_id_src ? "mmhub" : "gfxhub",
-		  entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-		  addr, entry->client_id, status);
+	if (printk_ratelimit()) {
+		dev_err(adev->dev,
+			"[%s] VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u)\n",
+			entry->vm_id_src ? "mmhub" : "gfxhub",
+			entry->src_id, entry->ring_id, entry->vm_id,
+			entry->pas_id);
+		dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+			addr, entry->client_id);
+		dev_err(adev->dev, "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+			status);
+	}
 
 	return 0;
 }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
 	/* This interrupt is VMC page fault.*/
 	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
 				&adev->mc.vm_fault);
+	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+				&adev->mc.vm_fault);
 
 	if (r)
 		return r;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1490653526-30073-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org

Reviewed-by Junwei Zhang
#2 lore raw
Quoted 5 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

May be better to split it into 2 patches

Quoted 34 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +11 -6
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
  		WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
  	}
 
-	DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
-		  "at page 0x%016llx from %d\n"
-		  "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-		  entry->vm_id_src ? "mmhub" : "gfxhub",
-		  entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-		  addr, entry->client_id, status);
+	if (printk_ratelimit()) {
+		dev_err(adev->dev,
+			"[%s] VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u)\n",
+			entry->vm_id_src ? "mmhub" : "gfxhub",
+			entry->src_id, entry->ring_id, entry->vm_id,
+			entry->pas_id);
+		dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+			addr, entry->client_id);
+		dev_err(adev->dev, "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+			status);
+	}
 
  	return 0;
  }

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 551

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -0
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
  	/* This interrupt is VMC page fault.*/
  	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
  				&adev->mc.vm_fault);
+	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+				&adev->mc.vm_fault);
 
  	if (r)
  		return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#4 lore raw

Am 28.03.2017 um 03:23 schrieb Zhang, Jerry (Junwei):

Quoted 10 lines · Felix Kuehling
Quoted 5 lines

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

May be better to split it into 2 patches

Yeah, would be nice to have. But should work this way as well and the hardware isn't even public.

Quoted 1 line
Quoted 43 lines
Quoted 43 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct 
 amdgpu_device *adev,
          WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
      }
 
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u 

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -5
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
+            "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u 

pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +10 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev, "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+            status);
+    }
 
      return 0;
  }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
      /* This interrupt is VMC page fault.*/
      r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                  &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 7 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 551

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
      if (r)
          return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw
In reply to a message not in the archive
Quoted 11 lines · Jerry (Junwei)
Quoted 5 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

May be better to split it into 2 patches

I had to rebase my patch and had to resolve a conflict with an SRIOV change that just landed. So I split it into two commits while I was at it. Please review the attached patches.

Thanks,
Felix

Quoted 44 lines
Quoted 44 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
          WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
      }
 
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -5
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
+            "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +10 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev, "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+            status);
+    }
 
      return 0;
  }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
      /* This interrupt is VMC page fault.*/
      r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                  &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 5 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 551

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
      if (r)
          return r;

From 9690de839e9ee7f6fc31cd777ffde8770858edb0 Mon Sep 17 00:00:00 2001

From: Felix Kuehling <[email protected]>
Date: Tue, 28 Mar 2017 13:41:11 -0400
Subject: [PATCH 1/2] drm/amdgpu: Register UTCL2 as a source of VM faults

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -0
index 87bea71..981d3d9 100644
@@ -556,6 +556,8 @@ static int gmc_v9_0_sw_init(void *handle)
 	/* This interrupt is VMC page fault.*/
 	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
 				&adev->mc.vm_fault);
+	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+				&adev->mc.vm_fault);
 
 	if (r)
 		return r;
Signature · 1 line
1.9.1
Quoted 1 line

From 9d47433ae1e799cacab2b002c75fcda41543beed Mon Sep 17 00:00:00 2001

From: Felix Kuehling <[email protected]>
Date: Tue, 28 Mar 2017 13:42:31 -0400
Subject: [PATCH 2/2] drm/amdgpu: Clean up GFX 9 VM fault messages

Clean up the VM fault message format and use rate-limiting similar to other ASICs.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +14 -13
index 981d3d9..1e4734d 100644
@@ -131,7 +131,7 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
 {
 	struct amdgpu_vmhub *gfxhub = &adev->vmhub[AMDGPU_GFXHUB];
 	struct amdgpu_vmhub *mmhub = &adev->vmhub[AMDGPU_MMHUB];
-	uint32_t status;
+	uint32_t status = 0;
 	u64 addr;
 
 	addr = (u64)entry->src_data[0] << 12;
@@ -145,19 +145,20 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
 			status = RREG32(gfxhub->vm_l2_pro_fault_status);
 			WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
 		}
+	}
 
-		DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
-		  "at page 0x%016llx from %d\n"
-		  "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-		  entry->vm_id_src ? "mmhub" : "gfxhub",
-		  entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-		  addr, entry->client_id, status);
-	} else {
-		DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
-		  "at page 0x%016llx from %d\n",
-		  entry->vm_id_src ? "mmhub" : "gfxhub",
-		  entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-		  addr, entry->client_id);
+	if (printk_ratelimit()) {
+		dev_err(adev->dev,
+			"[%s] VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u)\n",
+			entry->vm_id_src ? "mmhub" : "gfxhub",
+			entry->src_id, entry->ring_id, entry->vm_id,
+			entry->pas_id);
+		dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+			addr, entry->client_id);
+		if (!amdgpu_sriov_vf(adev))
+			dev_err(adev->dev,
+				"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
+				status);
 	}
 
 	return 0;
Signature · 1 line
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): e518dba8-03c1-5b8f-99a1-e0f7f5254c2f-5C7GfCeVMHo@public.gmane.org

Reviewed-by Alex Deucher
#7 lore raw
Quoted 16 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Tuesday, March 28, 2017 2:10 PM
To: Zhang, Jerry; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Improve Vega10 VM fault handling

Quoted 7 lines · Jerry (Junwei)
Quoted 4 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

May be better to split it into 2 patches

I had to rebase my patch and had to resolve a conflict with an SRIOV change that just landed. So I split it into two commits while I was at it. Please review the attached patches.

Quoted 50 lines

Thanks,
Felix

Quoted 24 lines
Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
          WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
      }
 
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -5
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev, · line 159

Quoted 8 lines

+ "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u
pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev,

"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -0
+            status);
+    }
 
      return 0;
  }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
      /* This interrupt is VMC page fault.*/
      r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                  &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 563

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
      if (r)
          return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652CBB8976C3AE74495C534F7320-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by Junwei Zhang
#9 lore raw
Quoted 18 lines · Alexander
Quoted 18 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Tuesday, March 28, 2017 2:10 PM
To: Zhang, Jerry; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Improve Vega10 VM fault handling

Quoted 9 lines · Jerry (Junwei)
Quoted 5 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

May be better to split it into 2 patches

I had to rebase my patch and had to resolve a conflict with an SRIOV change that just landed. So I split it into two commits while I was at it. Please review the attached patches.

Thanks.

Jerry

Quoted 51 lines
Quoted 51 lines

Thanks,
Felix

Quoted 24 lines
Quoted 24 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
          WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
      }
 
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -5
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev, · line 159

Quoted 8 lines

+ "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u
pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev,

"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -0
+            status);
+    }
 
      return 0;
  }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
      /* This interrupt is VMC page fault.*/
      r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                  &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 563

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
      if (r)
          return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw

Sorry, I pushed it already, just with Alex's R-B.

Thanks,
Felix

Quoted 84 lines · Jerry (Junwei)
Quoted 18 lines · Alexander
Quoted 18 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Tuesday, March 28, 2017 2:10 PM
To: Zhang, Jerry; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Improve Vega10 VM fault handling

Quoted 9 lines · Jerry (Junwei)
Quoted 5 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

May be better to split it into 2 patches

I had to rebase my patch and had to resolve a conflict with an SRIOV change that just landed. So I split it into two commits while I was at it. Please review the attached patches.

Thanks.

Jerry

Quoted 52 lines
Quoted 52 lines

Thanks,
Felix

Quoted 15 lines
Quoted 15 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
  1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
          WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
      }
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -4
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id,

entry->pas_id,

Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev, · line 159

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -1
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
+            "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev,

"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -0
+            status);
+    }
 
      return 0;
  }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
      /* This interrupt is VMC page fault.*/
      r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                  &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 563

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
      if (r)
          return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 7c852e67-d508-03d0-c148-b3dc6b28634c-5C7GfCeVMHo@public.gmane.org

#13 lore raw
Quoted 1 line · Felix Kuehling

Sorry, I pushed it already, just with Alex's R-B.

That's fine.
Take it easy :)

Jerry

Quoted 99 lines

Thanks,
Felix

Quoted 84 lines · Jerry (Junwei)
Quoted 18 lines · Alexander
Quoted 18 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Tuesday, March 28, 2017 2:10 PM
To: Zhang, Jerry; [email protected]
Subject: Re: [PATCH] drm/amdgpu: Improve Vega10 VM fault handling

Quoted 9 lines · Jerry (Junwei)
Quoted 5 lines · Felix Kuehling

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

May be better to split it into 2 patches

I had to rebase my patch and had to resolve a conflict with an SRIOV change that just landed. So I split it into two commits while I was at it. Please review the attached patches.

Thanks.

Jerry

Quoted 52 lines
Quoted 52 lines

Thanks,
Felix

Quoted 15 lines
Quoted 15 lines
---
   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
   1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
           WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
       }
 
Quoted 6 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
-    DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -4
-          "at page 0x%016llx from %d\n"
-          "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-          entry->vm_id_src ? "mmhub" : "gfxhub",
-          entry->src_id, entry->ring_id, entry->vm_id,

entry->pas_id,

Quoted 11 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -1
-          addr, entry->client_id, status);
+    if (printk_ratelimit()) {
+        dev_err(adev->dev,
+            "[%s] VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -0
+            entry->vm_id_src ? "mmhub" : "gfxhub",
+            entry->src_id, entry->ring_id, entry->vm_id,
+            entry->pas_id);
+        dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+            addr, entry->client_id);
+        dev_err(adev->dev,

"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -0
+            status);
+    }
 
       return 0;
   }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
       /* This interrupt is VMC page fault.*/
       r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
                   &adev->mc.vm_fault);
+    r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+                &adev->mc.vm_fault);
 
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c static int gmc_v9_0_sw_init(void *handle) · line 551

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -0
       if (r)
           return r;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 5 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Alex Deucher
#14 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Monday, March 27, 2017 6:25 PM
To: [email protected]
Cc: Kuehling, Felix
Subject: [PATCH] drm/amdgpu: Improve Vega10 VM fault handling

Quoted 5 lines

Register AMDGPU_IH_CLIENTID_UTCL2 as a source of VM faults. Clean up the VM fault message format and use rate-limiting similar to other ASICs.

Quoted 49 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +0 -1
index 232c208..9831025 100644
@@ -145,12 +145,17 @@ static int gmc_v9_0_process_interrupt(struct
 amdgpu_device *adev,
 		WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
 	}
 
-	DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u) "

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +3 -5
-		  "at page 0x%016llx from %d\n"
-		  "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
-		  entry->vm_id_src ? "mmhub" : "gfxhub",
-		  entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
-		  addr, entry->client_id, status);
+	if (printk_ratelimit()) {
+		dev_err(adev->dev,
+			"[%s] VMC page fault (src_id:%u ring:%u vm_id:%u

pas_id:%u)\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +6 -0
+			entry->vm_id_src ? "mmhub" : "gfxhub",
+			entry->src_id, entry->ring_id, entry->vm_id,
+			entry->pas_id);
+		dev_err(adev->dev, "  at page 0x%016llx from %d\n",
+			addr, entry->client_id);
+		dev_err(adev->dev,

"VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +4 -1
+			status);
+	}
 
 	return 0;
 }
@@ -539,6 +544,8 @@ static int gmc_v9_0_sw_init(void *handle)
 	/* This interrupt is VMC page fault.*/
 	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_VMC, 0,
 				&adev->mc.vm_fault);
+	r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_UTCL2, 0,
+				&adev->mc.vm_fault);
 
 	if (r)
 		return r;
--

1.9.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx