drm/amdgpu: Improve retry fault handling (v2)
Subsystems (2)
cover drm/amdgpu: Improve retry fault handling (v2)
Fix some issues regarding retry fault handling, such as enabling the retry fault interrupt (necessary for retry faults to work) and similar.
Improve retry faults on Navi 3 dGPUs by enabling the filter CAM, which can filter the repeated page fault interrupts that happen when retry faults are enabled, making the handling more efficient.
With this series, the kernel is able to mitigate most page faults on Navi 3 without causing a hang and without a need to reset the GPU, when the amdgpu.noretry=0 module parameter is set.
Changes in v2:
* Reordered patches in the series to put bug fixes first
* Enable retry fault interrupt in init_system_aperture_regs() instead of in set_fault_enable_default()
* Added a patch to respect the noretry flag on GFX12.1 too
Timur Kristóf (7):
drm/amdgpu: Use gmc->noretry instead of amdgpu_noretry directly drm/amdgpu/gfxhub: Program CRASH_ON_*_FAULT bits to 0 as needed drm/amdgpu/gmc: Don't compare page fault timestamps with other
interrupts
drm/amdgpu/ih: Add retry_cam_ack IH function pointer drm/amdgpu/gfxhub: Enable retry fault interrupts when needed drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1 drm/amdgpu: Enable retry CAM on Navi 3 dGPUs
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 +++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 21 ++++++++++++--------- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 21 ++++++++++++--------- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 16 +++++++--------- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 19 +++++++++++-------- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 12 ++++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 19 +++++++++++-------- drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 19 +++++++++++-------- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 21 ++++++++++++--------- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 21 ++++++++++++--------- drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 18 +++++++++++++++++- drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v4_1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 8 +++++++- 22 files changed, 141 insertions(+), 86 deletions(-)
Signature · 1 line
2.54.0
PATCH 1/7 drm/amdgpu: Use gmc->noretry instead of amdgpu_noretry directly
Whether retry faults are actually enabled, is determined by the amdgpu_gmc_noretry_set() function. The rest of the code base should use gmc->noretry instead of the module parameter.
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v4_1_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +1 -1
@@ -321,7 +321,7 @@ static void gfxhub_v11_5_0_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,GCVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (GC ,0 , regGCVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(GC, 0, regGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +1 -1
@@ -326,7 +326,7 @@ static void gfxhub_v12_0_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,GCVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (GC ,0 , regGCVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(GC, 0, regGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +1 -1
@@ -318,7 +318,7 @@ static void gfxhub_v3_0_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,GCVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (GC ,0 , regGCVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(GC, 0, regGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +1 -1
@@ -323,7 +323,7 @@ static void gfxhub_v3_0_3_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,GCVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (GC ,0 , regGCVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(GC, 0, regGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c +1 -1
@@ -340,7 +340,7 @@ static void mmhub_v3_0_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,0 , regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, 0, regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c +1 -1
@@ -333,7 +333,7 @@ static void mmhub_v3_0_1_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,0 , regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, 0, regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c +1 -1
@@ -339,7 +339,7 @@ static void mmhub_v3_0_2_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,0 , regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, 0, regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v3_3.c +1 -1
@@ -451,7 +451,7 @@ static void mmhub_v3_3_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,0 , regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, 0, regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v4_1_0.c +1 -1
@@ -334,7 +334,7 @@ static void mmhub_v4_1_0_setup_vmid_config(struct amdgpu_device *adev)/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,0 , regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, 0, regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
drivers/gpu/drm/amd/amdgpu/mmhub_v4_2_0.c +1 -1
@@ -518,7 +518,7 @@ static void mmhub_v4_2_0_mid_setup_vmid_config(struct amdgpu_device *adev,/* Send no-retry XNACK on fault to suppress VM fault storm. */ tmp =REG_SET_FIELD (tmp,MMVM_CONTEXT1_CNTL ,RETRY_PERMISSION_OR_INVALID_PAGE_FAULT , - !amdgpu_noretry); + !adev->gmc.noretry);WREG32_SOC15_OFFSET (MMHUB ,GET_INST (MMHUB , j), regMMVM_CONTEXT1_CNTL, i * hub->ctx_distance, tmp); WREG32_SOC15_OFFSET(MMHUB, GET_INST(MMHUB, j), regMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32,
Signature · 1 line
2.54.0
PATCH 2/7 drm/amdgpu/gfxhub: Program CRASH_ON_*_FAULT bits to 0 as needed
In reply to Timur KristófWhen the fault stop mode isn't AMDGPU_VM_FAULT_STOP_ALWAYS, these bits should be programmed to 0.
Program CRASH_ON_NO_RETRY_FAULT and CRASH_ON_RETRY_FAULT always, to make sure to clear the bits when we don't want to crash.
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 14 ++++++-------- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 10 ++++------ 9 files changed, 38 insertions(+), 56 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +4 -6
@@ -449,12 +449,10 @@ static void gfxhub_v11_5_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +4 -6
@@ -454,12 +454,10 @@ static void gfxhub_v12_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +6 -8
@@ -633,19 +633,17 @@ static void gfxhub_v12_1_xcc_set_fault_enable_default(struct amdgpu_device *adev tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL_LO32 ,OTHER_CLIENT_ID_NO_RETRY_FAULT_INTERRUPT , value); -if (!value) - tmp =REG_SET_FIELD (tmp, -GCVM_L2_PROTECTION_FAULT_CNTL_LO32 , -CRASH_ON_NO_RETRY_FAULT ,1 ); + tmp =REG_SET_FIELD (tmp, +GCVM_L2_PROTECTION_FAULT_CNTL_LO32 , +CRASH_ON_NO_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_LO32, tmp); tmp =RREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_HI32); -if (!value) - tmp =REG_SET_FIELD (tmp, -GCVM_L2_PROTECTION_FAULT_CNTL_HI32 , -CRASH_ON_RETRY_FAULT ,1 ); + tmp =REG_SET_FIELD (tmp, +GCVM_L2_PROTECTION_FAULT_CNTL_HI32 , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_HI32, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +4 -6
@@ -403,12 +403,10 @@ static void gfxhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +4 -6
@@ -516,12 +516,10 @@ static void gfxhub_v1_2_xcc_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL, tmp); } }
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +4 -6
@@ -418,12 +418,10 @@ static void gfxhub_v2_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +4 -6
@@ -449,12 +449,10 @@ static void gfxhub_v2_1_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +4 -6
@@ -446,12 +446,10 @@ static void gfxhub_v3_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +4 -6
@@ -434,12 +434,10 @@ static void gfxhub_v3_0_3_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }
Signature · 1 line
2.54.0
Re: [PATCH 2/7] drm/amdgpu/gfxhub: Program CRASH_ON_*_FAULT bits to 0 as needed
Applied patches 1 and 2.
Alex
Quoted 223 lines · Timur Kristóf
When the fault stop mode isn't
AMDGPU_VM_FAULT_STOP_ALWAYS, these bits should be programmed to 0.Program
CRASH_ON_NO_RETRY_FAULTandCRASH_ON_RETRY_FAULTalways, to make sure to clear the bits when we don't want to crash.Signed-off-by Timur Kristóf <[email protected]>Reviewed-by Christian König <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 14 ++++++-------- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 10 ++++------ drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 10 ++++------ 9 files changed, 38 insertions(+), 56 deletions(-)drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +4
-6@@ -449,12 +449,10 @@ static void gfxhub_v11_5_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +4
-6@@ -454,12 +454,10 @@ static void gfxhub_v12_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +6
-8@@ -633,19 +633,17 @@ static void gfxhub_v12_1_xcc_set_fault_enable_default(struct amdgpu_device *adev tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL_LO32 ,OTHER_CLIENT_ID_NO_RETRY_FAULT_INTERRUPT , value); -if (!value) - tmp =REG_SET_FIELD (tmp, -GCVM_L2_PROTECTION_FAULT_CNTL_LO32 , -CRASH_ON_NO_RETRY_FAULT ,1 ); + tmp =REG_SET_FIELD (tmp, +GCVM_L2_PROTECTION_FAULT_CNTL_LO32 , +CRASH_ON_NO_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_LO32, tmp); tmp =RREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_HI32); -if (!value) - tmp =REG_SET_FIELD (tmp, -GCVM_L2_PROTECTION_FAULT_CNTL_HI32 , -CRASH_ON_RETRY_FAULT ,1 ); + tmp =REG_SET_FIELD (tmp, +GCVM_L2_PROTECTION_FAULT_CNTL_HI32 , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL_HI32, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +4
-6@@ -403,12 +403,10 @@ static void gfxhub_v1_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +4
-6@@ -516,12 +516,10 @@ static void gfxhub_v1_2_xcc_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL, tmp); } }drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +4
-6@@ -418,12 +418,10 @@ static void gfxhub_v2_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +4
-6@@ -449,12 +449,10 @@ static void gfxhub_v2_1_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +4
-6@@ -446,12 +446,10 @@ static void gfxhub_v3_0_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +4
-7@@ -434,12 +434,10 @@ static void gfxhub_v3_0_3_set_fault_enable_default(struct amdgpu_device *adev, WRITE_PROTECTION_FAULT_ENABLE_DEFAULT, value); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL ,EXECUTE_PROTECTION_FAULT_ENABLE_DEFAULT , value); -if (!value) { - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_NO_RETRY_FAULT ,1 ); - tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , -CRASH_ON_RETRY_FAULT ,1 ); - } + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_NO_RETRY_FAULT , !value); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL , +CRASH_ON_RETRY_FAULT , !value);WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL, tmp); } --2.54.0
PATCH 3/7 drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
In reply to Timur KristófDifferent interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -1
@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,uint32_t hash;/* Stale retry fault if timestamp goes backward */ -if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || +amdgpu_ih_ts_after (timestamp, adev->gmc.processed_fault_timestamp))return true; + adev->gmc.processed_fault_timestamp =MAX (timestamp, adev->gmc.processed_fault_timestamp); +/* If we don't have space left in the ring buffer return immediately */ stamp =max (timestamp,AMDGPU_GMC_FAULT_TIMEOUT +1 ) -AMDGPU_GMC_FAULT_TIMEOUT ;
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1 -0
@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Signature · 1 line
2.54.0
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 10 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are, how does that relate to the timestamp_src field, and if there are indeed multiple clock domains should the patch perhaps be generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?
Regards,
Tvrtko
Quoted 37 lines
Signed-off-by Timur Kristóf <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4
-1@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,uint32_t hash;/* Stale retry fault if timestamp goes backward */ -if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || +amdgpu_ih_ts_after (timestamp, adev->gmc.processed_fault_timestamp))return true; + adev->gmc.processed_fault_timestamp =MAX (timestamp, adev->gmc.processed_fault_timestamp); +/* If we don't have space left in the ring buffer return immediately */ stamp =max (timestamp,AMDGPU_GMC_FAULT_TIMEOUT +1 ) -AMDGPU_GMC_FAULT_TIMEOUT ;drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 4 lines · Central European Summer Time Tvrtko Ursulin
Quoted 3 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
Quoted 8 lines
Quoted 7 lines
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.
Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
As far as I know there are various timestamp sources in the GPU and some interrupts use different ones. I am not aware of any documentation on this topic, unfortunately.
Quoted 1 line
how does that relate to the
timestamp_srcfield
The timestamp_src field is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.
Quoted 3 lines
and if there are indeed multiple clock domains should the patch perhaps be generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?
For the context of this patch, I think it doesn't matter how many different kinds of time stamps there are. What's important is that we just shouldn't compare timestamps of page faults with time stamps of other interrupts.
As far as I see the timestamp doesn't really matter for other interrupts as we only use it to filter out page faults and nothing else.
Hope this helps,
Timur
Quoted 22 lines
Quoted 12 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c bool amdgpu_gmc_filter_faults(struct amdgpu_device · line 443
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2
-1@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,> uint32_t hash;/* Stale retry fault if timestamp goes backward */ -if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
Quoted 1 line
Quoted 6 lines
Quoted 6 lines
return true;
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-0+ adev->gmc.processed_fault_timestamp = MAX(timestamp,
adev->gmc.processed_fault_timestamp); +/* If we don't have space left in the ring buffer return
immediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-
AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool
flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 31 lines · Timur Kristóf
Quoted 4 lines · Central European Summer Time Tvrtko Ursulin
Quoted 3 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
Quoted 8 lines
Quoted 7 lines
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
As far as I know there are various timestamp sources in the GPU and some interrupts use different ones. I am not aware of any documentation on this topic, unfortunately.
Quoted 1 line
how does that relate to the
timestamp_srcfieldThe
timestamp_srcfield is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.
Quoted 7 lines
Quoted 3 lines
and if there are indeed multiple clock domains should the patch perhaps be generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?
For the context of this patch, I think it doesn't matter how many different kinds of time stamps there are. What's important is that we just shouldn't compare timestamps of page faults with time stamps of other interrupts.
True, thank you!
Another question is why the backward timestamp check is needed only for fault interrupts? I do not see it elsewhere.
Let me also ask two more things below.
Quoted 27 lines
As far as I see the timestamp doesn't really matter for other interrupts as we only use it to filter out page faults and nothing else.
Hope this helps,
TimurQuoted 21 lines
Quoted 12 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c bool amdgpu_gmc_filter_faults(struct amdgpu_device · line 443
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2
-1@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,> uint32_t hash;/* Stale retry fault if timestamp goes backward */ -if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
First thing is whether you are confident the equality check is either safe or required?
For example can two blocks fault with the same timestamp on different addresses?
Or from a different angle, is the clock granularity good enough to not coalesce two separate faults to a single timestamp?
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-0return true; + adev->gmc.processed_fault_timestamp = MAX(timestamp,
adev->gmc.processed_fault_timestamp); +
Doesn't a plain assign work here? The if above has already verified new timestamp is larger than the old.
Regards,
Tvrtko
Quoted 25 lines
Quoted 2 lines
Quoted 2 lines
/* If we don't have space left in the ring buffer returnimmediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 42 lines · Central European Summer Time Tvrtko Ursulin
Quoted 36 lines · Timur Kristóf
On Monday, June 15, 2026 4:32:23 PM Central European Summer Time Tvrtko
Quoted 11 lines · Ursulin
Quoted 10 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
As far as I know there are various timestamp sources in the GPU and some interrupts use different ones. I am not aware of any documentation on this topic, unfortunately.
Quoted 1 line
how does that relate to the
timestamp_srcfieldThe
timestamp_srcfield is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.Quoted 4 lines
and if there are indeed multiple clock domains should the patch perhaps be
generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?Quoted 4 lines
For the context of this patch, I think it doesn't matter how many different
kinds of time stamps there are. What's important is that we just shouldn't compare timestamps of page faults with time stamps of other interrupts.
Quoted 4 lines
True, thank you!
Another question is why the backward timestamp check is needed only for fault interrupts? I do not see it elsewhere.
Correct, this is only used for retry fault interrupts and only when they are dispatched to the soft IH ring.
The reason this was added is because when retry faults are enabled and the GPU hits a VM fault, it keeps spamming the CPU with many interrupts for the same fault until the fault is resolved. The CPU needs to filter out the faults which it is already handling, otherwise we would end up handling the same fault multiple times.
(As a side note, I should also probably look into how to reduce the frequency of how often these interrupts are repeated.)
Quoted 27 lines
Let me also ask two more things below.
Quoted 24 lines
As far as I see the timestamp doesn't really matter for other interrupts as we only use it to filter out page faults and nothing else.
Hope this helps,
TimurQuoted 18 lines
Quoted 18 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,>uint32_t hash;/* Stale retry fault if timestamp goes backward */
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2
-1-if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
First thing is whether you are confident the equality check is either safe or required?
I don't see why it wouldn't be safe. But maybe it isn't required. What do you suggest instead?
Quoted 2 lines
For example can two blocks fault with the same timestamp on different addresses?
They might. But keep in mind that the GFX block just keeps spamming the interrupts until the fault is handled. So, if we filter one out by mistake, we know we will just receive the same fault again very soon.
Quoted 2 lines
Or from a different angle, is the clock granularity good enough to not coalesce two separate faults to a single timestamp?
I am not sure about that.
Quoted 35 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-0return true; + adev->gmc.processed_fault_timestamp = MAX(timestamp,
adev->gmc.processed_fault_timestamp); +Doesn't a plain assign work here? The if above has already verified new timestamp is larger than the old.
Regards,
Tvrtko
Quoted 22 lines
Quoted 1 line
Quoted 1 line
/* If we don't have space left in the ring buffer returnimmediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 49 lines · Timur Kristóf
Quoted 42 lines · Central European Summer Time Tvrtko Ursulin
Quoted 36 lines · Timur Kristóf
On Monday, June 15, 2026 4:32:23 PM Central European Summer Time Tvrtko
Quoted 11 lines · Ursulin
Quoted 10 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
As far as I know there are various timestamp sources in the GPU and some interrupts use different ones. I am not aware of any documentation on this topic, unfortunately.
Quoted 1 line
how does that relate to the
timestamp_srcfieldThe
timestamp_srcfield is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.Quoted 4 lines
and if there are indeed multiple clock domains should the patch perhaps be
generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?Quoted 4 lines
For the context of this patch, I think it doesn't matter how many different
kinds of time stamps there are. What's important is that we just shouldn't compare timestamps of page faults with time stamps of other interrupts.Quoted 4 lines
True, thank you!
Another question is why the backward timestamp check is needed only for fault interrupts? I do not see it elsewhere.
Quoted 8 lines
Correct, this is only used for retry fault interrupts and only when they are dispatched to the soft IH ring.
The reason this was added is because when retry faults are enabled and the GPU hits a VM fault, it keeps spamming the CPU with many interrupts for the same fault until the fault is resolved. The CPU needs to filter out the faults which it is already handling, otherwise we would end up handling the same fault multiple times.
Got it, thank you!
Quoted 36 lines
(As a side note, I should also probably look into how to reduce the frequency of how often these interrupts are repeated.)
Quoted 33 lines
Let me also ask two more things below.
Quoted 29 lines
As far as I see the timestamp doesn't really matter for other interrupts as we only use it to filter out page faults and nothing else.
Hope this helps,
TimurQuoted 23 lines
Quoted 12 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c bool amdgpu_gmc_filter_faults(struct amdgpu_device · line 444
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2
-1@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,> uint32_t hash;/* Stale retry fault if timestamp goes backward */ -if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
Quoted 5 lines
Quoted 2 lines
First thing is whether you are confident the equality check is either safe or required?
I don't see why it wouldn't be safe. But maybe it isn't required. What do you suggest instead?
Safe as is whether it has potential to swallow a legitimate unseen faults.
Looking at amdgpu_gmc_filter_faults() a bit lower down, it does appear to filter out repeated faults on the same address. Would it be safe to rely on that instead of the timestamp equality check?
I appreciate that may cause a transient interrupt handling storm if the clock granularity is poor, but maybe that is better than losing a fault.
Quoted 11 lines
Quoted 2 lines
For example can two blocks fault with the same timestamp on different addresses?
They might. But keep in mind that the GFX block just keeps spamming the interrupts until the fault is handled. So, if we filter one out by mistake, we know we will just receive the same fault again very soon.
Quoted 2 lines
Or from a different angle, is the clock granularity good enough to not coalesce two separate faults to a single timestamp?
I am not sure about that.
I guess if the equality filter can be removed then this concern also goes away.
Regards,
Tvrtko
Quoted 39 lines
Quoted 35 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-0return true; + adev->gmc.processed_fault_timestamp = MAX(timestamp,
adev->gmc.processed_fault_timestamp); +Doesn't a plain assign work here? The if above has already verified new timestamp is larger than the old.
Regards,
Tvrtko
Quoted 22 lines
Quoted 1 line
Quoted 1 line
/* If we don't have space left in the ring buffer returnimmediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-
AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
A bit late to the discussion, sorry. Trying to answer questions now.
Quoted 25 lines · Tvrtko Ursulin
Quoted 24 lines · Timur Kristóf
Quoted 22 lines · Central European Summer Time Tvrtko Ursulin
Quoted 21 lines · Timur Kristóf
On Monday, June 15, 2026 4:32:23 PM Central European Summer Time Tvrtko
Quoted 11 lines · Ursulin
Quoted 10 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
As far as I know there are various timestamp sources in the GPU and some interrupts use different ones. I am not aware of any documentation on this topic, unfortunately.
Quoted 1 line
how does that relate to the
timestamp_srcfield
The timestamp_src bit indicates if the timestamp came from the IH block which wrote the IV to memory or the original IP block which signaled the IH that an interrupt happened.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
The
timestamp_srcfield is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.Quoted 4 lines
and if there are indeed multiple clock domains should the patch perhaps be
generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
For the context of this patch, I think it doesn't matter how many different
kinds of time stamps there are. What's important is that we just shouldn't compare timestamps of page faults with time stamps of other interrupts.True, thank you!
Yeah, completely agree.
Quoted 54 lines
Quoted 4 lines
Quoted 3 lines
Another question is why the backward timestamp check is needed only for fault interrupts? I do not see it elsewhere.
Quoted 8 lines
Correct, this is only used for retry fault interrupts and only when they are dispatched to the soft IH ring.
The reason this was added is because when retry faults are enabled and the GPU hits a VM fault, it keeps spamming the CPU with many interrupts for the same fault until the fault is resolved. The CPU needs to filter out the faults which it is already handling, otherwise we would end up handling the same fault multiple times.
Got it, thank you!
Quoted 39 lines
(As a side note, I should also probably look into how to reduce the frequency of how often these interrupts are repeated.)
Quoted 35 lines
Let me also ask two more things below.
Quoted 29 lines
As far as I see the timestamp doesn't really matter for other interrupts as we only use it to filter out page faults and nothing else.
Hope this helps,
TimurQuoted 23 lines
Quoted 18 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c| 5 ++++-drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h| 1 +2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct amdgpu_device *adev,> uint32_t hash;
/* Stale retry fault if timestamp goes backward */Quoted 3 lines
- if (
amdgpu_ih_ts_after(timestamp, ih->processed_timestamp)) + if (timestamp ==adev->gmc.processed_fault_timestamp|| + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
First thing is whether you are confident the equality check is either safe or required?
Quoted 6 lines
Quoted 2 lines
I don't see why it wouldn't be safe. But maybe it isn't required. What do you suggest instead?
Safe as is whether it has potential to swallow a legitimate unseen faults.
Looking at
amdgpu_gmc_filter_faults()a bit lower down, it does appear to filter out repeated faults on the same address. Would it be safe to rely on that instead of the timestamp equality check?
Yes.
The check was added with patch to make retry page faults more resilent to IH ring buffer overflow:
commit 3c2d6ea27955cfac8590884d207353eece8c2cee
Author: Philip Yang <[email protected]> Date: Thu Nov 18 15:24:55 2021 -0500
drm/amdgpu: handle IH ring1 overflow
IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and wptr to handle overflow and drain retry fault.
If fault timestamp goes backward, the fault is filtered and should not be processed. Drain fault is finished if processed_timestamp is equal to or larger than checkpoint timestamp.
Add amdgpu_ih_functions interface decode_iv_ts for different chips to get timestamp from IV entry with different iv size and timestamp offset. amdgpu_ih_decode_iv_ts_helper is used for vega10, vega20, navi10.
But as far as I can see the whole idea is completely broken. The timestamp can also go backward in case of a reset for example.
So having this check like this is clearly a bad idea.
What we could do in amdgpu_gmc_filter_faults() is to check some range for the timestamp, e.g. last seen timestamp (in amdgpu_gmc_filter_faults(), e.g. only faults) - value X is considered a duplicate caused by ring buffer wrap around.
Regards,
Christian.
Quoted 61 lines
I appreciate that may cause a transient interrupt handling storm if the clock granularity is poor, but maybe that is better than losing a fault.
Quoted 11 lines
Quoted 2 lines
For example can two blocks fault with the same timestamp on different addresses?
They might. But keep in mind that the GFX block just keeps spamming the interrupts until the fault is handled. So, if we filter one out by mistake, we know we will just receive the same fault again very soon.
Quoted 2 lines
Or from a different angle, is the clock granularity good enough to not coalesce two separate faults to a single timestamp?
I am not sure about that.
I guess if the equality filter can be removed then this concern also goes away.
Regards,
Tvrtko
Quoted 39 lines
Quoted 35 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
return true;
+
adev->gmc.processed_fault_timestamp=MAX(timestamp, adev->gmc.processed_fault_timestamp); +Doesn't a plain assign work here? The if above has already verified new timestamp is larger than the old.
Regards,
Tvrtko
Quoted 22 lines
Quoted 1 line
Quoted 1 line
/* If we don't have space left in the ring buffer return
immediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-
AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc { u64 noretry_flags; u64 init_pte_flags; + u64 processed_fault_timestamp; bool flush_tlb_needs_extra_type_0;bool
flush_tlb_needs_extra_type_2;
Re: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 153 lines · Central European Summer Time Christian König
A bit late to the discussion, sorry. Trying to answer questions now.
Quoted 26 lines · Tvrtko Ursulin
Quoted 25 lines · Timur Kristóf
On Monday, June 15, 2026 5:23:52 PM Central European Summer Time Tvrtko
Quoted 22 lines · Ursulin
Quoted 21 lines · Timur Kristóf
On Monday, June 15, 2026 4:32:23 PM Central European Summer Time Tvrtko
Quoted 11 lines · Ursulin
Quoted 10 lines · Timur Kristóf
Different interrupts may have different timestamp sources, which shouldn't be compared.
If we compare the timestamps of retry faults to timestamps of other interrupts, it may result in all retry fault interrupts being filtered out, because of the different time stamp source.
This issue was observed on Strix Halo.
Solved by storing the timestamp of the last page fault interrupt.Hi,
Quoted 3 lines
This one may require access to AMD docs to review. For example I am immediately curious as to how many different clock sources on a single IH there are
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
As far as I know there are various timestamp sources in the GPU and some
interrupts use different ones. I am not aware of any documentation on this
topic, unfortunately.Quoted 1 line
how does that relate to the
timestamp_srcfieldThe
timestamp_srcbit indicates if the timestamp came from the IH block which wrote the IV to memory or the original IP block which signaled the IH that an interrupt happened.Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
The
timestamp_srcfield is set differently when the timestamp source is different. So, it could happen that we accidentally filter out all page faults when we shouldn't.Quoted 5 lines
and if there are indeed multiple clock domains should the patch perhaps
be
generalized to something like ih->processed_timestamp[entry->timestamp_src] or something?Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
For the context of this patch, I think it doesn't matter how many different
kinds of time stamps there are. What's important is that we just shouldn't
compare timestamps of page faults with time stamps of other interrupts.True, thank you!
Yeah, completely agree.
Quoted 54 lines
Quoted 11 lines
Quoted 2 lines
Another question is why the backward timestamp check is needed only for fault interrupts? I do not see it elsewhere.
Correct, this is only used for retry fault interrupts and only when they are dispatched to the soft IH ring.
The reason this was added is because when retry faults are enabled and the GPU hits a VM fault, it keeps spamming the CPU with many interrupts for the same fault until the fault is resolved. The CPU needs to filter out the faults which it is already handling, otherwise we would end up handling the same fault multiple times.
Got it, thank you!
Quoted 40 lines
(As a side note, I should also probably look into how to reduce the frequency of how often these interrupts are repeated.)
Quoted 36 lines
Let me also ask two more things below.
Quoted 4 lines
As far as I see the timestamp doesn't really matter for other interrupts
as we only use it to filter out page faults and nothing else.Quoted 27 lines
Hope this helps,
TimurQuoted 24 lines
Quoted 19 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex13bec8461cde..52258f1341c2100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0@@ -437,9 +437,12 @@ bool amdgpu_gmc_filter_faults(struct
amdgpu_device
*adev,>uint32_t hash; /* Stale retry fault if timestamp goes backward */drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +2
-1-if (amdgpu_ih_ts_after (timestamp, ih->processed_timestamp)) +if (timestamp == adev->gmc.processed_fault_timestamp || + amdgpu_ih_ts_after(timestamp, adev-gmc.processed_fault_timestamp))
First thing is whether you are confident the equality check is either safe or required?
Quoted 8 lines
Quoted 2 lines
I don't see why it wouldn't be safe. But maybe it isn't required. What do you suggest instead?
Safe as is whether it has potential to swallow a legitimate unseen faults.
Looking at
amdgpu_gmc_filter_faults()a bit lower down, it does appear to filter out repeated faults on the same address. Would it be safe to rely on that instead of the timestamp equality check?Yes.
The check was added with patch to make retry page faults more resilent to IH ring buffer overflow: commit
3c2d6ea27955cfac8590884d207353eece8c2cee
Author: Philip Yang <[email protected]>
Date: Thu Nov 18 15:24:55 2021 -0500drm/amdgpu: handle IH ring1 overflow
IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and wptr to handle overflow and drain retry fault.
If fault timestamp goes backward, the fault is filtered and should not be processed. Drain fault is finished if
processed_timestampis equal to
or larger than checkpoint timestamp.Add
amdgpu_ih_functionsinterfacedecode_iv_tsfor different chips to get timestamp from IV entry with different iv size and timestamp offset.amdgpu_ih_decode_iv_ts_helperis used for vega10, vega20, navi10.Signed-off-by Philip Yang <[email protected]>Reviewed-by Felix Kuehling <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>But as far as I can see the whole idea is completely broken. The timestamp can also go backward in case of a reset for example.
Quoted 7 lines
So having this check like this is clearly a bad idea.
What we could do in
amdgpu_gmc_filter_faults()is to check some range for the timestamp, e.g. last seen timestamp (inamdgpu_gmc_filter_faults(), e.g. only faults) - value X is considered a duplicate caused by ring buffer wrap around.
Hi,
I agree that filtering based on timestamps is not a good idea in general, and we should probably re-think it. I wish someone had thought of that in 2021 when the above patch was accepted.
Maybe this patch should be dropped and the timestamp check should be removed instead. What do you guys think about that?
Best regards,
Timur
Quoted 56 lines
Quoted 56 lines
I appreciate that may cause a transient interrupt handling storm if the clock granularity is poor, but maybe that is better than losing a fault.>
Quoted 11 lines
Quoted 2 lines
For example can two blocks fault with the same timestamp on different addresses?
They might. But keep in mind that the GFX block just keeps spamming the interrupts until the fault is handled. So, if we filter one out by mistake, we know we will just receive the same fault again very soon.
Quoted 2 lines
Or from a different angle, is the clock granularity good enough to not coalesce two separate faults to a single timestamp?
I am not sure about that.
I guess if the equality filter can be removed then this concern also goes away.
Regards,
Tvrtko
Quoted 34 lines
Quoted 34 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
return true;+
adev->gmc.processed_fault_timestamp= MAX(timestamp,adev->gmc.processed_fault_timestamp); +Doesn't a plain assign work here? The if above has already verified new timestamp is larger than the old.
Regards,
Tvrtko
Quoted 22 lines
Quoted 1 line
Quoted 1 line
/* If we don't have space left in the ring buffer returnimmediately */
Quoted 18 lines
Quoted 18 lines
stamp =
max(timestamp, AMDGPU_GMC_FAULT_TIMEOUT + 1)-
AMDGPU_GMC_FAULT_TIMEOUT;(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.hindex676e3aaa1f27..77eb15380284100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +1
-0@@ -361,6 +361,7 @@ struct amdgpu_gmc {u64 noretry_flags;u64 init_pte_flags; +u64 processed_fault_timestamp;bool flush_tlb_needs_extra_type_0;bool flush_tlb_needs_extra_type_2;
Christian König
maintainerRe: [PATCH 3/7] drm/amdgpu/gmc: Don't compare page fault timestamps with other interrupts
Quoted 2 lines · Timur Kristóf
On Tuesday, June 16, 2026 12:15:12 PM Central European Summer Time Christian König wrote:
...
Quoted 37 lines
Quoted 29 lines
The check was added with patch to make retry page faults more resilent to IH ring buffer overflow: commit
3c2d6ea27955cfac8590884d207353eece8c2cee
Author: Philip Yang <[email protected]>
Date: Thu Nov 18 15:24:55 2021 -0500drm/amdgpu: handle IH ring1 overflow
IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and wptr to handle overflow and drain retry fault.
If fault timestamp goes backward, the fault is filtered and should not be processed. Drain fault is finished if
processed_timestampis equal to
or larger than checkpoint timestamp.Add
amdgpu_ih_functionsinterfacedecode_iv_tsfor different chips to get timestamp from IV entry with different iv size and timestamp offset.amdgpu_ih_decode_iv_ts_helperis used for vega10, vega20, navi10.Signed-off-by Philip Yang <[email protected]>Reviewed-by Felix Kuehling <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>But as far as I can see the whole idea is completely broken. The timestamp can also go backward in case of a reset for example.
Quoted 7 lines
So having this check like this is clearly a bad idea.
What we could do in
amdgpu_gmc_filter_faults()is to check some range for the timestamp, e.g. last seen timestamp (inamdgpu_gmc_filter_faults(), e.g. only faults) - value X is considered a duplicate caused by ring buffer wrap around.
Quoted 5 lines
Hi,
I agree that filtering based on timestamps is not a good idea in general, and we should probably re-think it. I wish someone had thought of that in 2021 when the above patch was accepted.
I remember that I brought up some concerns about that when we originally reviewed the patch, but it was quite an urgent fix (as always) so we accepted it in the end.
Quoted 2 lines
Maybe this patch should be dropped and the timestamp check should be removed instead. What do you guys think about that?
That's fine with me but adding Philip just in case we could run into regressions with that.
Regards,
Christian.
Quoted 3 lines
Best regards,
Timur
PATCH 4/7 drm/amdgpu/ih: Add retry_cam_ack IH function pointer
In reply to Timur KristófInstead of writing the doorbell in amdgpu_gmc_handle_retry_fault() directly, add an IH function pointer which can be defined in a different way for different IH versions.
This is to allow implementing the filter CAM without a doorbell.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 8 +++++++- 4 files changed, 15 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 -1
@@ -565,7 +565,7 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev, ret =amdgpu_vm_handle_fault (adev, entry->pasid, entry->vmid, node_id, addr, entry->timestamp, write_fault); -WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); + adev->irq.ih_funcs->retry_cam_ack (adev, cam_index);if (ret)return 1 ; }else {
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +1 -0
@@ -97,6 +97,7 @@ struct amdgpu_ih_funcs {const char *(*node_id_to_die_name)(struct amdgpu_device *adev,unsigned int node_id,char *buf,size_t size); +void (*retry_cam_ack)(struct amdgpu_device *adev,u32 cam_index); };#define amdgpu_ih_get_wptr (adev, ih) (adev)->irq.ih_funcs->get_wptr((adev), (ih))
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +6 -0
@@ -289,6 +289,11 @@ static uint32_t ih_v7_0_setup_retry_doorbell(u32 doorbell_index)return val; } +static void ih_v7_0_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +#define regIH_RING1_CLIENT_CFG_INDEX_V7_1 0x122#define regIH_RING1_CLIENT_CFG_INDEX_V7_1_BASE_IDX 0#define regIH_RING1_CLIENT_CFG_DATA_V7_1 0x123
@@ -858,6 +863,7 @@ static const struct amdgpu_ih_funcs ih_v7_0_funcs = { .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, .set_rptr = ih_v7_0_set_rptr, .node_id_to_die_name = ih_v7_0_node_id_to_die_name, + .retry_cam_ack = ih_v7_0_retry_cam_ack, };static void ih_v7_0_set_interrupt_funcs (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/vega20_ih.c +7 -1
@@ -293,6 +293,11 @@ static uint32_t vega20_setup_retry_doorbell(u32 doorbell_index)return val; } +static void vega20_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +/** * vega20_ih_irq_init - init and enable the interrupt ring *
@@ -738,7 +743,8 @@ static const struct amdgpu_ih_funcs vega20_ih_funcs = { .get_wptr = vega20_ih_get_wptr, .decode_iv = amdgpu_ih_decode_iv_helper, .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, - .set_rptr = vega20_ih_set_rptr + .set_rptr = vega20_ih_set_rptr, + .retry_cam_ack = vega20_retry_cam_ack, };static void vega20_ih_set_interrupt_funcs (struct amdgpu_device *adev)
Signature · 1 line
2.54.0
Re: [PATCH 4/7] drm/amdgpu/ih: Add retry_cam_ack IH function pointer
Quoted 19 lines · Timur Kristóf
Instead of writing the doorbell in
amdgpu_gmc_handle_retry_fault()directly, add an IH function pointer which can be defined in a different way for different IH versions.This is to allow implementing the filter CAM without a doorbell.
Signed-off-by Timur Kristóf <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 8 +++++++- 4 files changed, 15 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev, · line 568
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-1@@ -565,7 +565,7 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev, ret =amdgpu_vm_handle_fault (adev, entry->pasid, entry->vmid, node_id, addr, entry->timestamp, write_fault); -WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); + adev->irq.ih_funcs->retry_cam_ack (adev, cam_index);
How does not map which IP generations can end up calling it? Presumably your selection of ih_v7_0 and vega20_ih.c is an insightful one, but for me I see amdgpu_gmc_handle_retry_fault() is called from gmc_v9_0_process_interrupt, gmc_v10_0_process_interrupt, gmc_v11_0_process_interrupt and gmc_v12_0_process_interrupt(). Is there a map somewhere which shows which GMC versions go with which IH blocks?
Regards,
Tvrtko
Quoted 65 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0if (ret)return 1 ; }else {drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +1
-0@@ -97,6 +97,7 @@ struct amdgpu_ih_funcs {const char *(*node_id_to_die_name)(struct amdgpu_device *adev,unsigned int node_id,char *buf,size_t size); +void (*retry_cam_ack)(struct amdgpu_device *adev,u32 cam_index); };#define amdgpu_ih_get_wptr (adev, ih) (adev)->irq.ih_funcs->get_wptr((adev), (ih))drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +6
-0@@ -289,6 +289,11 @@ static uint32_t ih_v7_0_setup_retry_doorbell(u32 doorbell_index)return val; } +static void ih_v7_0_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +#define regIH_RING1_CLIENT_CFG_INDEX_V7_1 0x122#define regIH_RING1_CLIENT_CFG_INDEX_V7_1_BASE_IDX 0#define regIH_RING1_CLIENT_CFG_DATA_V7_1 0x123@@ -858,6 +863,7 @@ static const struct amdgpu_ih_funcs ih_v7_0_funcs = { .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, .set_rptr = ih_v7_0_set_rptr, .node_id_to_die_name = ih_v7_0_node_id_to_die_name, + .retry_cam_ack = ih_v7_0_retry_cam_ack, };static void ih_v7_0_set_interrupt_funcs (struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/vega20_ih.c +7
-1@@ -293,6 +293,11 @@ static uint32_t vega20_setup_retry_doorbell(u32 doorbell_index)return val; } +static void vega20_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +/** * vega20_ih_irq_init - init and enable the interrupt ring * @@ -738,7 +743,8 @@ static const struct amdgpu_ih_funcs vega20_ih_funcs = { .get_wptr = vega20_ih_get_wptr, .decode_iv = amdgpu_ih_decode_iv_helper, .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, - .set_rptr = vega20_ih_set_rptr + .set_rptr = vega20_ih_set_rptr, + .retry_cam_ack = vega20_retry_cam_ack, };static void vega20_ih_set_interrupt_funcs (struct amdgpu_device *adev)
Re: [PATCH 4/7] drm/amdgpu/ih: Add retry_cam_ack IH function pointer
Quoted 16 lines · Central European Summer Time Tvrtko Ursulin
Quoted 15 lines · Timur Kristóf
Instead of writing the doorbell in
amdgpu_gmc_handle_retry_fault()directly, add an IH function pointer which can be defined in a different way for different IH versions.This is to allow implementing the filter CAM without a doorbell.
Signed-off-by Timur Kristóf <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 8 +++++++- 4 files changed, 15 insertions(+), 2 deletions(-)
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_handle_retry_fault(struct amdgpu_device · line 566
Quoted 8 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.cindex52258f1341c2..d790b7619ccd100644drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0@@ -565,7 +565,7 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev,> ret = amdgpu_vm_handle_fault(adev, entry->pasid,
entry->vmid, node_id,
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_handle_retry_fault(struct amdgpu_device · line 567
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0addr, entry-timestamp,
write_fault);drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_handle_retry_fault(struct amdgpu_device · line 568
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-1- WDOORBELL32(adev->irq.retry_cam_doorbell_index,
cam_index);
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev, · line 568
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-0+ adev->irq.ih_funcs->retry_cam_ack (adev, cam_index);How does not map which IP generations can end up calling it? Presumably your selection of
ih_v7_0andvega20_ih.cis an insightful one, but for me I seeamdgpu_gmc_handle_retry_fault()is called fromgmc_v9_0_process_interrupt,gmc_v10_0_process_interrupt,gmc_v11_0_process_interruptandgmc_v12_0_process_interrupt(). Is there a map somewhere which shows which GMC versions go with which IH blocks?
The hardware writes interrupt data into a so-called IH ring (interrupt handler ring):
- Old GPUs only have one IH ring
- Newer dedicated GPUs have two IH rings
- APUs only have one IH ring
- Additionally there is a soft IH ring, which is implemented entirely in the driver and is used to make the processing more reliable.
Specifically for retry faults, it is beneficial to configure page fault interrupts on the second IH ring (when available) to avoid them competing with other interrupts for space in the ring. In the upstream code this is only done on Vega dGPUs. My series implements that for GFX11 and a subsequent series also for GFX12 dGPUs.
To answer your actual question, it all depends on the IH IP block for any given generation. For some GPUs (but not all), the IH code configures the hardware to use the second IH ring for page fault interrupts. For everything else, the first IH ring is used. On GFX12 it seems the interrupts are handled on the first IH ring even though the second ring is configured; it's unclear if that's a bug or missing code in the kernel.
Hope this helps,
Timur
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +0
-0if (ret)return 1 ;} else {(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.hindex444437c30088..e6e34f6e86f4100644drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +0
-0@@ -97,6 +97,7 @@ struct amdgpu_ih_funcs {
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h struct amdgpu_ih_funcs {
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +0
-0const char *(*node_id_to_die_name)(struct amdgpu_device *adev, unsigned int
node_id,
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h struct amdgpu_ih_funcs { · line 101
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +0
-0char *buf, size_t
size);
Quoted 76 lines
Quoted 76 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +1
-0+void (*retry_cam_ack)(struct amdgpu_device *adev,u32 cam_index);};#define
amdgpu_ih_get_wptr(adev, ih)
(adev)->irq.ih_funcs->get_wptr((adev), (ih))>(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.cindex6de9e87e04e1..c2431f4c2671100644drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +0
-0@@ -289,6 +289,11 @@ static uint32_t ih_v7_0_setup_retry_doorbell(u32
doorbell_index)>
return val;}+static void
ih_v7_0_retry_cam_ack(struct amdgpu_device *adev, u32 cam_index)+{drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +4
-0+WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +#define regIH_RING1_CLIENT_CFG_INDEX_V7_1 0x122#define regIH_RING1_CLIENT_CFG_INDEX_V7_1_BASE_IDX 0#define regIH_RING1_CLIENT_CFG_DATA_V7_1 0x123@@ -858,6 +863,7 @@ static const struct amdgpu_ih_funcs ih_v7_0_funcs = { .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, .set_rptr = ih_v7_0_set_rptr, .node_id_to_die_name = ih_v7_0_node_id_to_die_name, + .retry_cam_ack = ih_v7_0_retry_cam_ack,};static void
ih_v7_0_set_interrupt_funcs(struct amdgpu_device *adev)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/vega20_ih.cindex85846fd08ce4..30a82fff3ff7100644drivers/gpu/drm/amd/amdgpu/vega20_ih.c +0
-0@@ -293,6 +293,11 @@ static uint32_t vega20_setup_retry_doorbell(u32
doorbell_index)>
return val;}+static void
vega20_retry_cam_ack(struct amdgpu_device *adev, u32 cam_index)+{drivers/gpu/drm/amd/amdgpu/vega20_ih.c +5
-1+WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +/** * vega20_ih_irq_init - init and enable the interrupt ring * @@ -738,7 +743,8 @@ static const struct amdgpu_ih_funcs vega20_ih_funcs = { .get_wptr = vega20_ih_get_wptr, .decode_iv = amdgpu_ih_decode_iv_helper, .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, - .set_rptr = vega20_ih_set_rptr + .set_rptr = vega20_ih_set_rptr, + .retry_cam_ack = vega20_retry_cam_ack,};static void
vega20_ih_set_interrupt_funcs(struct amdgpu_device *adev)
Christian König
maintainerRe: [PATCH 4/7] drm/amdgpu/ih: Add retry_cam_ack IH function pointer
In reply to Timur KristófHi guys,
who is familiar with the implementation details of the IH CAM which filters page faults?
Timur stumbled over some differences in how that is implemented on different HW generations and somebody with more HW background than me needs to take a look.
Thanks,
Christian.
Quoted 89 lines · Timur Kristóf
Instead of writing the doorbell in
amdgpu_gmc_handle_retry_fault()directly, add an IH function pointer which can be defined in a different way for different IH versions.This is to allow implementing the filter CAM without a doorbell.
Signed-off-by Timur Kristóf <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 8 +++++++- 4 files changed, 15 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1
-1@@ -565,7 +565,7 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev, ret =amdgpu_vm_handle_fault (adev, entry->pasid, entry->vmid, node_id, addr, entry->timestamp, write_fault); -WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); + adev->irq.ih_funcs->retry_cam_ack (adev, cam_index);if (ret)return 1 ; }else {drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +1
-0@@ -97,6 +97,7 @@ struct amdgpu_ih_funcs {const char *(*node_id_to_die_name)(struct amdgpu_device *adev,unsigned int node_id,char *buf,size_t size); +void (*retry_cam_ack)(struct amdgpu_device *adev,u32 cam_index); };#define amdgpu_ih_get_wptr (adev, ih) (adev)->irq.ih_funcs->get_wptr((adev), (ih))drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +6
-0@@ -289,6 +289,11 @@ static uint32_t ih_v7_0_setup_retry_doorbell(u32 doorbell_index)return val; } +static void ih_v7_0_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +#define regIH_RING1_CLIENT_CFG_INDEX_V7_1 0x122#define regIH_RING1_CLIENT_CFG_INDEX_V7_1_BASE_IDX 0#define regIH_RING1_CLIENT_CFG_DATA_V7_1 0x123@@ -858,6 +863,7 @@ static const struct amdgpu_ih_funcs ih_v7_0_funcs = { .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, .set_rptr = ih_v7_0_set_rptr, .node_id_to_die_name = ih_v7_0_node_id_to_die_name, + .retry_cam_ack = ih_v7_0_retry_cam_ack, };static void ih_v7_0_set_interrupt_funcs (struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/vega20_ih.c +7
-1@@ -293,6 +293,11 @@ static uint32_t vega20_setup_retry_doorbell(u32 doorbell_index)return val; } +static void vega20_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WDOORBELL32 (adev->irq.retry_cam_doorbell_index, cam_index); +} +/** * vega20_ih_irq_init - init and enable the interrupt ring * @@ -738,7 +743,8 @@ static const struct amdgpu_ih_funcs vega20_ih_funcs = { .get_wptr = vega20_ih_get_wptr, .decode_iv = amdgpu_ih_decode_iv_helper, .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, - .set_rptr = vega20_ih_set_rptr + .set_rptr = vega20_ih_set_rptr, + .retry_cam_ack = vega20_retry_cam_ack, };static void vega20_ih_set_interrupt_funcs (struct amdgpu_device *adev)
PATCH 5/7 drm/amdgpu/gfxhub: Enable retry fault interrupts when needed
In reply to Timur KristófEnable retry fault interrupts when initializing the GFXHUB system aperture registers according to whether retrying page faults is enabled in amdgpu (ie. amdgpu.noretry=0).
Needs to be done for each GFXHUB version at once, because none of them actually enabled this interrupt.
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 9 +++++++-- 8 files changed, 51 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +7 -2
@@ -155,6 +155,7 @@ static void gfxhub_v11_5_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v11_5_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BOT, adev->gmc.agp_start >>24 );
@@ -180,8 +181,12 @@ static void gfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }static void gfxhub_v11_5_0_init_tlb_regs (struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +7 -2
@@ -158,6 +158,7 @@ static void gfxhub_v12_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v12_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );
@@ -184,8 +185,12 @@ static void gfxhub_v12_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +7 -2
@@ -91,6 +91,7 @@ static void gfxhub_v1_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v1_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (!amdgpu_sriov_vf (adev) || adev->asic_type <=CHIP_VEGA10 ) {/* Program the AGP BAR */
@@ -134,8 +135,12 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,VM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL2, tmp); }/* In the case squeezing vram into GART aperture, we don't use
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +2 -0
@@ -176,6 +176,8 @@ gfxhub_v1_2_xcc_init_system_aperture_regs(struct amdgpu_device *adev, tmp =RREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL2); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry);WREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +7 -2
@@ -151,6 +151,7 @@ static void gfxhub_v2_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v2_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (!amdgpu_sriov_vf (adev)) {/* Program the AGP BAR */
@@ -178,8 +179,12 @@ static void gfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +7 -2
@@ -154,6 +154,7 @@ static void gfxhub_v2_1_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v2_1_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (amdgpu_sriov_vf (adev))return ;
@@ -182,8 +183,12 @@ static void gfxhub_v2_1_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +7 -2
@@ -150,6 +150,7 @@ static void gfxhub_v3_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v3_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );
@@ -176,8 +177,12 @@ static void gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +7 -2
@@ -153,6 +153,7 @@ static void gfxhub_v3_0_3_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v3_0_3_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (amdgpu_sriov_vf (adev))return ;
@@ -181,8 +182,12 @@ static void gfxhub_v3_0_3_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
Signature · 1 line
2.54.0
Re: [PATCH 5/7] drm/amdgpu/gfxhub: Enable retry fault interrupts when needed
Quoted 33 lines · Timur Kristóf
Enable retry fault interrupts when initializing the GFXHUB system aperture registers according to whether retrying page faults is enabled in amdgpu (ie. amdgpu.noretry=0).
Needs to be done for each GFXHUB version at once, because none of them actually enabled this interrupt.
Signed-off-by Timur Kristóf <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 9 +++++++-- 8 files changed, 51 insertions(+), 14 deletions(-)drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +1
-0@@ -155,6 +155,7 @@ static void gfxhub_v11_5_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v11_5_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BOT, adev->gmc.agp_start >>24 );@@ -180,8 +181,12 @@ static void gfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev) WREG32_SOC15(GC, 0, regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c static void gfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev) · line 189
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +6
-2(u32)((u64)adev->dummy_page_addr >> 44)); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp);
As a side note, I have two patches which shrink these register access macros considerably:
https://patchwork.freedesktop.org/patch/720726/?series=165432&rev=1
Going back to this patch, a question - how do gfxhub ip versions relate to the default set from gc ip versions in amdgpu_gmc_noretry_set()? I am wondering on which platforms, if any, do at this point in the series, retry fault interrupts get enabled where they previously were not.
Regards,
Tvrtko
Quoted 178 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +0
-0}static void gfxhub_v11_5_0_init_tlb_regs (struct amdgpu_device *adev)drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +7
-2@@ -158,6 +158,7 @@ static void gfxhub_v12_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v12_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );@@ -184,8 +185,12 @@ static void gfxhub_v12_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +7
-2@@ -91,6 +91,7 @@ static void gfxhub_v1_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v1_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (!amdgpu_sriov_vf (adev) || adev->asic_type <=CHIP_VEGA10 ) {/* Program the AGP BAR */ @@ -134,8 +135,12 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,VM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmVM_L2_PROTECTION_FAULT_CNTL2, tmp); }/* In the case squeezing vram into GART aperture, we don't use drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +2
-0@@ -176,6 +176,8 @@ gfxhub_v1_2_xcc_init_system_aperture_regs(struct amdgpu_device *adev, tmp =RREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL2); tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,VM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry);WREG32_SOC15 (GC ,GET_INST (GC , i), regVM_L2_PROTECTION_FAULT_CNTL2, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +7
-2@@ -151,6 +151,7 @@ static void gfxhub_v2_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v2_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (!amdgpu_sriov_vf (adev)) {/* Program the AGP BAR */ @@ -178,8 +179,12 @@ static void gfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +7
-2@@ -154,6 +154,7 @@ static void gfxhub_v2_1_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v2_1_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (amdgpu_sriov_vf (adev))return ;@@ -182,8 +183,12 @@ static void gfxhub_v2_1_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +7
-2@@ -150,6 +150,7 @@ static void gfxhub_v3_0_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v3_0_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );@@ -176,8 +177,12 @@ static void gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +7
-2@@ -153,6 +153,7 @@ static void gfxhub_v3_0_3_init_gart_aperture_regs(struct amdgpu_device *adev)static void gfxhub_v3_0_3_init_system_aperture_regs (struct amdgpu_device *adev) {uint64_t value; +u32 tmp;if (amdgpu_sriov_vf (adev))return ;@@ -181,8 +182,12 @@ static void gfxhub_v3_0_3_init_system_aperture_regs(struct amdgpu_device *adev)WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32, (u32)((u64 )adev->dummy_page_addr >>44 )); -WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry); +WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
Re: [PATCH 5/7] drm/amdgpu/gfxhub: Enable retry fault interrupts when needed
Quoted 31 lines · Central European Summer Time Tvrtko Ursulin
Quoted 30 lines · Timur Kristóf
Enable retry fault interrupts when initializing the GFXHUB system aperture registers according to whether retrying page faults is enabled in amdgpu (ie. amdgpu.noretry=0).
Needs to be done for each GFXHUB version at once, because none of them actually enabled this interrupt.
Signed-off-by Timur Kristóf <[email protected]>---
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 9 +++++++-- drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c | 9 +++++++-- 8 files changed, 51 insertions(+), 14 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.cindex652eea6eae4a..ef20eafd59ae100644drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +0
-0@@ -155,6 +155,7 @@ static void
gfxhub_v11_5_0_init_gart_aperture_regs(struct amdgpu_device *adev)>
static voidgfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev){
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c static void gfxhub_v11_5_0_init_gart_aperture_regs(struct amdgpu_device *adev)
Quoted 6 lines
uint64_tvalue;drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +1
-0+u32 tmp;WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 ); WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BOT, adev->gmc.agp_start >>
24);
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +0
-0@@ -180,8 +181,12 @@ static void
gfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,
regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c static void gfxhub_v11_5_0_init_system_aperture_regs(struct amdgpu_device *adev)
Quoted 8 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +3
-2-WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v11_5_0.c +1
-0+WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp);As a side note, I have two patches which shrink these register access macros considerably:
https://patchwork.freedesktop.org/patch/720726/?series=165432&rev=1
Going back to this patch, a question - how do gfxhub ip versions relate to the default set from gc ip versions in
amdgpu_gmc_noretry_set()? I am wondering on which platforms, if any, do at this point in the series, retry fault interrupts get enabled where they previously were not.
As far as I know, currently retry faults are only enabled by default on some datacenter GPUs and not for any consumer GPUs.
This patch just makes sure to actually program the registers to enable retry faults when they need to be enabled (at the moment, this means, when the user has amdgpu.noretry=0 on their kernel command line). The series does not change which generations have it enabled by default.
In order to enable retry faults by default, I would like to make work reliably first. At the moment that blocked by Christian's recent refactor which is currently under review. I will have to rebase those two patches once Christian's work lands. Then we can consider enabling retry faults by default on Navi 3 and Navi 4 dGPUs.
Note that APUs and Navi 1-2 dGPUs will still need more work because they don't have the retry CAM so they will need a better way to filter the page fault interrupts. However I don't want to start working on that until the current three series is reviewed.
Thanks,
Timur
Quoted 17 lines
Quoted 17 lines
}static void
gfxhub_v11_5_0_init_tlb_regs(struct amdgpu_device *adev)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.cindex6cbf837d50dd..ec3ff4dec674100644drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +0
-0@@ -158,6 +158,7 @@ static void
gfxhub_v12_0_init_gart_aperture_regs(struct amdgpu_device *adev)>
static voidgfxhub_v12_0_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +1
-0+u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );@@ -184,8 +185,12 @@ static void
gfxhub_v12_0_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,
regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c
Quoted 8 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +3
-2-WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_0.c +1
-0+WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.cindexbfe247b1a333..27d7f7cb903f100644drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +0
-0@@ -91,6 +91,7 @@ static void gfxhub_v1_0_init_gart_aperture_regs(struct
amdgpu_device*adev)>
static voidgfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1
-0+u32 tmp;
Quoted 7 lines
Quoted 7 lines
if (!amdgpu_sriov_vf(adev) || adev->asic_type <= CHIP_VEGA10) {/* Program the AGP BAR */
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +0
-0@@ -134,8 +135,12 @@ static void
gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,
mmVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 2 lines
Quoted 2 lines
(u32)((u64)adev->dummy_page_addr >>
44));
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +0
-2- WREG32_FIELD15(GC, 0, VM_L2_PROTECTION_FAULT_CNTL2, - ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY,
1);
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1
-0+ tmp = RREG32_SOC15(GC, 0,
mmVM_L2_PROTECTION_FAULT_CNTL2);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, VM_L2_PROTECTION_FAULT_CNTL2, +
ENABLE_RETRY_FAULT_INTERRUPT, !adev->gmc.noretry);
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1
-0+ WREG32_SOC15(GC, 0, mmVM_L2_PROTECTION_FAULT_CNTL2,
tmp);
Quoted 5 lines
Quoted 5 lines
}/* In the case squeezing vram into GART aperture, we don't use
Quoted 10 lines
Quoted 10 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.cindexfbdf46070b38..ed9a64bc5aaa100644drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +0
-0@@ -176,6 +176,8 @@ gfxhub_v1_2_xcc_init_system_aperture_regs(struct
amdgpu_device*adev,>
tmp =RREG32_SOC15(GC, GET_INST(GC, i), regVM_L2_PROTECTION_FAULT_CNTL2); tmp = REG_SET_FIELD(tmp,
VM_L2_PROTECTION_FAULT_CNTL2,
Quoted 2 lines
Quoted 2 lines
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +1
-0+ tmp = REG_SET_FIELD(tmp,
VM_L2_PROTECTION_FAULT_CNTL2,
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +1
-0+
ENABLE_RETRY_FAULT_INTERRUPT, !adev->gmc.noretry);
Quoted 2 lines
Quoted 2 lines
WREG32_SOC15(GC,
GET_INST(GC, i),
regVM_L2_PROTECTION_FAULT_CNTL2,
Quoted 26 lines
Quoted 26 lines
tmp);
}(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.cindex9ea593e2c719..152b2735d360100644drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +0
-0@@ -151,6 +151,7 @@ static void gfxhub_v2_0_init_gart_aperture_regs(struct
amdgpu_device*adev)>
static voidgfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +1
-0+u32 tmp;if (!amdgpu_sriov_vf (adev)) {/* Program the AGP BAR */ @@ -178,8 +179,12 @@ static void
gfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c static void gfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev)
Quoted 7 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +3
-2-WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 26 lines
Quoted 26 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +1
-0+WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.cindex30b90d35abd0..83c2ddbbd292100644drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +0
-0@@ -154,6 +154,7 @@ static void gfxhub_v2_1_init_gart_aperture_regs(struct
amdgpu_device*adev)>
static voidgfxhub_v2_1_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +1
-0+u32 tmp;if (amdgpu_sriov_vf (adev))return ;@@ -182,8 +183,12 @@ static void
gfxhub_v2_1_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,mmGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c
Quoted 7 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +3
-2-WREG32_FIELD15 (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +1
-0+WREG32_SOC15 (GC ,0 , mmGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.cindex9e6a6e13dec0..90bbb2fe4884100644drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +0
-0@@ -150,6 +150,7 @@ static void gfxhub_v3_0_init_gart_aperture_regs(struct
amdgpu_device*adev)>
static voidgfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +1
-0+u32 tmp;/* Program the AGP BAR */ WREG32_SOC15 (GC ,0 , regGCMC_VM_AGP_BASE,0 );@@ -176,8 +177,12 @@ static void
gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,
regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c
Quoted 8 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +3
-2-WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 18 lines
Quoted 18 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +1
-0+WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.cindexb3b1085c7cd3..1b3c067ab48c100644drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +0
-0@@ -153,6 +153,7 @@ static void
gfxhub_v3_0_3_init_gart_aperture_regs(struct amdgpu_device *adev)>
static voidgfxhub_v3_0_3_init_system_aperture_regs(struct amdgpu_device *adev){
uint64_tvalue;drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +1
-0+u32 tmp;
Quoted 7 lines
Quoted 7 lines
if (
amdgpu_sriov_vf(adev))return;
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +0
-0@@ -181,8 +182,12 @@ static void
gfxhub_v3_0_3_init_system_aperture_regs(struct amdgpu_device *adev)>
WREG32_SOC15(GC, 0,
regGCVM_L2_PROTECTION_FAULT_DEFAULT_ADDR_HI32,
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c
Quoted 8 lines
(u32)((u64)adev->dummy_page_addr >> 44));drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +3
-2-WREG32_FIELD15_PREREG (GC ,0 ,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); + tmp =RREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2); + tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, +
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +2
-0+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, !
adev->gmc.noretry);
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +1
-0+WREG32_SOC15 (GC ,0 , regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
PATCH 6/7 drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1
In reply to Timur KristófWhen retry faults are disabled (amdgpu.noretry=1), the ENABLE_RETRY_FAULT_INTERRUPT bit should be programmed to 0.
Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled.
--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +1 -1
@@ -243,7 +243,7 @@ static void gfxhub_v12_1_xcc_init_system_aperture_regs(struct amdgpu_device *ade tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ENABLE_RETRY_FAULT_INTERRUPT ,0x1 ); +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
Signature · 1 line
2.54.0
Re: [PATCH 6/7] drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1
Quoted 16 lines · Timur Kristóf
When retry faults are disabled (amdgpu.noretry=1), the
ENABLE_RETRY_FAULT_INTERRUPTbit should be programmed to 0.Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled.
Signed-off-by Timur Kristóf <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-0
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c static void gfxhub_v12_1_xcc_init_system_aperture_regs(struct amdgpu_device *ade · line 249
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +1
-1@@ -243,7 +243,7 @@ static void gfxhub_v12_1_xcc_init_system_aperture_regs(struct amdgpu_device *ade tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 ,ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY ,1 ); tmp =REG_SET_FIELD (tmp,GCVM_L2_PROTECTION_FAULT_CNTL2 , -ENABLE_RETRY_FAULT_INTERRUPT ,0x1 ); +ENABLE_RETRY_FAULT_INTERRUPT , !adev->gmc.noretry);WREG32_SOC15 (GC ,GET_INST (GC , i), regGCVM_L2_PROTECTION_FAULT_CNTL2, tmp); }
If I look at 6f894c92490b ("drm/amdgpu: Enable retry faults for GFX 12.1") which added this code, it also touched gfxhub_v12_1_xcc_setup_vmid_config():
tmp = REG_SET_FIELD(tmp, GCVM_CONTEXT1_CNTL,
RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
- !amdgpu_noretry);
+ 1);
Should that be changed as well?
Regards,
Tvrtko
Re: [PATCH 6/7] drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1
Quoted 13 lines · Central European Summer Time Tvrtko Ursulin
Quoted 12 lines · Timur Kristóf
When retry faults are disabled (amdgpu.noretry=1), the
ENABLE_RETRY_FAULT_INTERRUPTbit should be programmed to 0.Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled.
Signed-off-by Timur Kristóf <[email protected]>---
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 8 lines
Quoted 8 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.cindex4c2fd1e6616e..d2edfe037da8100644drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-0@@ -243,7 +243,7 @@ static voidgfxhub_v12_1_xcc_init_system_aperture_regs(struct
amdgpu_device*ade>
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,
Quoted 2 lines
Quoted 2 lines
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);
Quoted 2 lines
Quoted 2 lines
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-1- ENABLE_RETRY_FAULT_INTERRUPT,
0x1);
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +1
-0+ ENABLE_RETRY_FAULT_INTERRUPT,
!adev->gmc.noretry);
Quoted 4 lines
Quoted 4 lines
WREG32_SOC15(GC,
GET_INST(GC, i),
regGCVM_L2_PROTECTION_FAULT_CNTL2,
tmp);
Quoted 12 lines
Quoted 2 lines
}If I look at
6f894c92490b("drm/amdgpu: Enable retry faults for GFX 12.1") which added this code, it also touchedgfxhub_v12_1_xcc_setup_vmid_config():tmp = REG_SET_FIELD(tmp,
GCVM_CONTEXT1_CNTL,
RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,(quoted diff) +1
-1- !amdgpu_noretry); + 1);
Quoted 2 lines
Should that be changed as well?
I personally don't have a GFX12.1 GPU so I have no way to verify how that works, which is why I try to avoid changing it unless it's pretty obvious that the upstream code is wrong.
Can you elaborate on what you are suggesting exactly?
Thanks,
Timur
Re: [PATCH 6/7] drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1
Quoted 52 lines · Timur Kristóf
Quoted 13 lines · Central European Summer Time Tvrtko Ursulin
Quoted 12 lines · Timur Kristóf
When retry faults are disabled (amdgpu.noretry=1), the
ENABLE_RETRY_FAULT_INTERRUPTbit should be programmed to 0.Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled.
Signed-off-by Timur Kristóf <[email protected]>---
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 8 lines
Quoted 8 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.cindex4c2fd1e6616e..d2edfe037da8100644drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-0@@ -243,7 +243,7 @@ static voidgfxhub_v12_1_xcc_init_system_aperture_regs(struct
amdgpu_device*ade>
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,Quoted 2 lines
Quoted 2 lines
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);Quoted 2 lines
Quoted 2 lines
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-1- ENABLE_RETRY_FAULT_INTERRUPT,
0x1);Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +1
-0+ ENABLE_RETRY_FAULT_INTERRUPT,!adev->gmc.noretry);
Quoted 4 lines
Quoted 4 lines
WREG32_SOC15(GC, GET_INST(GC, i), regGCVM_L2_PROTECTION_FAULT_CNTL2,tmp);
Quoted 12 lines
Quoted 2 lines
}If I look at
6f894c92490b("drm/amdgpu: Enable retry faults for GFX 12.1") which added this code, it also touchedgfxhub_v12_1_xcc_setup_vmid_config():tmp = REG_SET_FIELD(tmp,
GCVM_CONTEXT1_CNTL,
RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,(quoted diff) +1
-1- !amdgpu_noretry); + 1);
Quoted 8 lines
Quoted 2 lines
Should that be changed as well?
I personally don't have a GFX12.1 GPU so I have no way to verify how that works, which is why I try to avoid changing it unless it's pretty obvious that the upstream code is wrong.
Can you elaborate on what you are suggesting exactly?
I'm asking. :)
commit 6f894c92490be1bb27492a82544b4b1e4ad20915
Author: Mukul Joshi <[email protected]> Date: Wed Mar 26 22:06:39 2025 -0400
drm/amdgpu: Enable retry faults for GFX 12.1
Made these three changes:
gfxhub_v12_1_xcc_init_system_aperture_regs:
+ tmp = REG_SET_FIELD(tmp, GCVM_L2_PROTECTION_FAULT_CNTL2,
+ ENABLE_RETRY_FAULT_INTERRUPT, 0x1);
gfxhub_v12_1_xcc_setup_vmid_config:
- !amdgpu_noretry);
+ 1);
mmhub_v4_2_0_mid_init_system_aperture_regs:
+ tmp = REG_SET_FIELD(tmp, MMVM_L2_PROTECTION_FAULT_CNTL2,
+ ENABLE_RETRY_FAULT_INTERRUPT, 0x1);
The claim from that one was that it is enabling retry faults on gfx 12.1. If that is correct, and we look at your patch which wants respect the noretry modparam, but only changes one of those three.
So question is are you confident it is only that one you need to change to make it respect the modparam? I don't know to be clear, those are just things I spot while reading you patch and the relevant history trying to familiarise myself with this area.
Regards,
Tvrtko
Re: [PATCH 6/7] drm/amdgpu/gfxhub: Respect noretry flag for retry faults on GFX12.1
Quoted 98 lines · Central European Summer Time Tvrtko Ursulin
Quoted 62 lines · Timur Kristóf
On Tuesday, June 16, 2026 10:09:53 AM Central European Summer Time Tvrtko
Quoted 21 lines · Ursulin
Quoted 20 lines · Timur Kristóf
When retry faults are disabled (amdgpu.noretry=1), the
ENABLE_RETRY_FAULT_INTERRUPTbit should be programmed to 0.Note that retry faults are enabled by default on GFX12.1 so this just fixes the case when they are explicitly disabled.
Signed-off-by Timur Kristóf <[email protected]>---
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.cindex4c2fd1e6616e..d2edfe037da8100644drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-0@@ -243,7 +243,7 @@ static voidgfxhub_v12_1_xcc_init_system_aperture_regs(struct
amdgpu_device*ade>Quoted 1 line
Quoted 1 line
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,
ACTIVE_PAGE_MIGRATION_PTE_READ_RETRY, 1);Quoted 1 line
Quoted 1 line
tmp = REG_SET_FIELD(tmp,
GCVM_L2_PROTECTION_FAULT_CNTL2,Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +0
-1- ENABLE_RETRY_FAULT_INTERRUPT,
0x1);Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c +1
-0+ ENABLE_RETRY_FAULT_INTERRUPT,!adev->gmc.noretry);
Quoted 3 lines
Quoted 3 lines
WREG32_SOC15(GC, GET_INST(GC, i), regGCVM_L2_PROTECTION_FAULT_CNTL2,tmp);
Quoted 13 lines
Quoted 1 line
}If I look at
6f894c92490b("drm/amdgpu: Enable retry faults for GFX 12.1") which added this code, it also touched
gfxhub_v12_1_xcc_setup_vmid_config():
tmp = REG_SET_FIELD(tmp,GCVM_CONTEXT1_CNTL,
RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,(quoted diff) +1
-1- !amdgpu_noretry); + 1);Quoted 7 lines
Quoted 1 line
Should that be changed as well?
I personally don't have a GFX12.1 GPU so I have no way to verify how that works, which is why I try to avoid changing it unless it's pretty obvious that the upstream code is wrong.
Can you elaborate on what you are suggesting exactly?
I'm asking. :)
commit
6f894c92490be1bb27492a82544b4b1e4ad20915Author: Mukul Joshi <[email protected]> Date: Wed Mar 26 22:06:39 2025 -0400drm/amdgpu: Enable retry faults for GFX 12.1
Made these three changes:
gfxhub_v12_1_xcc_init_system_aperture_regs:
+ tmp = REG_SET_FIELD(tmp,GCVM_L2_PROTECTION_FAULT_CNTL2,
+ENABLE_RETRY_FAULT_INTERRUPT,0x1);
gfxhub_v12_1_xcc_setup_vmid_config:(quoted diff) +1
-1- !amdgpu_noretry); + 1);
mmhub_v4_2_0_mid_init_system_aperture_regs:(quoted diff) +2
-0+ tmp = REG_SET_FIELD(tmp, MMVM_L2_PROTECTION_FAULT_CNTL2, + ENABLE_RETRY_FAULT_INTERRUPT, 0x1);
Quoted 8 lines
The claim from that one was that it is enabling retry faults on gfx 12.1. If that is correct, and we look at your patch which wants respect the noretry modparam, but only changes one of those three.
So question is are you confident it is only that one you need to change to make it respect the modparam? I don't know to be clear, those are just things I spot while reading you patch and the relevant history trying to familiarise myself with this area.
I think I see what you mean.
Indeed it would make sense to change the patch to use the gmc->noretry flag there as well. Will add that to the next version.
Thanks,
Timur
PATCH 7/7 drm/amdgpu: Enable retry CAM on Navi 3 dGPUs
In reply to Timur KristófThe retry CAM can filter interrupts which occur repeatedly, such as page fault interrupts when retry faults are enabled. This makes processing those interrupts much more efficient, because the CPU won't have to deal with processing the same interrupt repeatedly.
--- drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 5 ++++- drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +4 -1
@@ -108,13 +108,16 @@ static int gmc_v11_0_process_interrupt(struct amdgpu_device *adev,bool write_fault = !!(entry->src_data[1 ] &AMDGPU_GMC9_FAULT_SOURCE_DATA_WRITE );uint32_t status =0 ; +uint32_t cam_index;u64 addr; addr = (u64 )entry->src_data[0 ] <<12 ; addr |= ((u64 )entry->src_data[1 ] &0xf ) <<44 ;if (retry_fault) { -int ret =amdgpu_gmc_handle_retry_fault (adev, entry, addr,0 ,0 , + cam_index = entry->src_data[2 ] &0x3ff ; + +int ret =amdgpu_gmc_handle_retry_fault (adev, entry, addr, cam_index,0 , write_fault);/* Returning 1 here also prevents sending the IV to the KFD */ if (ret ==1 )
drivers/gpu/drm/amd/amdgpu/ih_v6_0.c +17 -1
@@ -307,6 +307,11 @@ static int ih_v6_0_enable_ring(struct amdgpu_device *adev,return 0 ; } +static void ih_v6_0_retry_cam_ack (struct amdgpu_device *adev,u32 cam_index) +{ +WREG32_SOC15 (OSSSYS ,0 , regIH_RETRY_CAM_ACK, cam_index); +} +/** * ih_v6_0_irq_init - init and enable the interrupt ring *
@@ -392,6 +397,16 @@ static int ih_v6_0_irq_init(struct amdgpu_device *adev)pci_set_master (adev->pdev); +if (!(adev->flags &AMD_IS_APU )) { +/* Enable IH Retry CAM */ + tmp =RREG32_SOC15 (OSSSYS ,0 , regIH_RETRY_INT_CAM_CNTL); + tmp =REG_SET_FIELD (tmp,IH_RETRY_INT_CAM_CNTL ,ENABLE ,1 ); + tmp =REG_SET_FIELD (tmp,IH_RETRY_INT_CAM_CNTL ,CAM_SIZE ,0xF ); +WREG32_SOC15 (OSSSYS ,0 , regIH_RETRY_INT_CAM_CNTL, tmp); + + adev->irq.retry_cam_enabled = true; + } +/* enable interrupts */ ret =ih_v6_0_toggle_interrupts (adev, true);if (ret)
@@ -800,7 +815,8 @@ static const struct amdgpu_ih_funcs ih_v6_0_funcs = { .get_wptr = ih_v6_0_get_wptr, .decode_iv = amdgpu_ih_decode_iv_helper, .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, - .set_rptr = ih_v6_0_set_rptr + .set_rptr = ih_v6_0_set_rptr, + .retry_cam_ack = ih_v6_0_retry_cam_ack, };static void ih_v6_0_set_interrupt_funcs (struct amdgpu_device *adev)
Signature · 1 line
2.54.0