On 17-03-27 09:23 PM, Zhang, Jerry (Junwei) wrote: > > > On 03/28/2017 06:25 AM, Felix Kuehling wrote: >> 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. >> >> Signed-off-by: Felix Kuehling <felix.kuehl...@amd.com> > > May be better to split it into 2 patches > Reviewed-by: Junwei Zhang <jerry.zh...@amd.com>
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 > >> --- >> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 19 +++++++++++++------ >> 1 file changed, 13 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c >> b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c >> index 232c208..9831025 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c >> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c >> @@ -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; >>
>From 9690de839e9ee7f6fc31cd777ffde8770858edb0 Mon Sep 17 00:00:00 2001 From: Felix Kuehling <felix.kuehl...@amd.com> Date: Tue, 28 Mar 2017 13:41:11 -0400 Subject: [PATCH 1/2] drm/amdgpu: Register UTCL2 as a source of VM faults Signed-off-by: Felix Kuehling <felix.kuehl...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 87bea71..981d3d9 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -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; -- 1.9.1
>From 9d47433ae1e799cacab2b002c75fcda41543beed Mon Sep 17 00:00:00 2001 From: Felix Kuehling <felix.kuehl...@amd.com> 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. Signed-off-by: Felix Kuehling <felix.kuehl...@amd.com> --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 981d3d9..1e4734d 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -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; -- 1.9.1
_______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx