On 16/09/2026 23:55, Timur Kristóf wrote:
Use the same helper for GMC v12.1 that is used by other
GMC IP block versions.

No functional changes intended. Just code cleanup.

Signed-off-by: Timur Kristóf <[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 45 ++++----------------------
  1 file changed, 7 insertions(+), 38 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
index 3349e8bc1c20..cfc46f912d47 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
@@ -131,7 +131,7 @@ static int gmc_v12_1_process_interrupt(struct amdgpu_device 
*adev,
        struct amdgpu_vmhub *hub;
        uint32_t cam_index = 0;
        const char *hub_name;
-       int ret, xcc_id = 0;
+       int xcc_id = 0;
        uint32_t status = 0, status_hi = 0;
        const char *die_name;
        char die_name_buf[32];
@@ -164,44 +164,13 @@ static int gmc_v12_1_process_interrupt(struct 
amdgpu_device *adev,
        hub = &adev->vmhub[vmhub];
if (retry_fault) {
-               if (adev->irq.retry_cam_enabled) {
-                       /* Delegate it to a different ring if the hardware 
hasn't
-                        * already done it.
-                        */
-                       if (entry->ih == &adev->irq.ih) {
-                               amdgpu_irq_delegate(adev, entry, 8);
-                               return 1;
-                       }
-
-                       cam_index = entry->src_data[3] & 0x3ff;
-
-                       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);
-                       if (ret)
-                               return 1;
-               } else {
-                       /* Process it onyl if it's the first fault for this 
address */
-                       if (entry->ih != &adev->irq.ih_soft &&
-                               amdgpu_gmc_filter_faults(adev, entry->ih, addr, 
entry->pasid,
-                                                        entry->timestamp))
-                               return 1;
-
-                       /* Delegate it to a different ring if the hardware 
hasn't
-                        * already done it.
-                        */
-                       if (entry->ih == &adev->irq.ih) {
-                               amdgpu_irq_delegate(adev, entry, 8);
-                               return 1;
-                       }
+               cam_index = entry->src_data[3] & 0x3ff;
- /* Try to handle the recoverable page faults by filling page
-                        * tables
-                        */
-                       if (amdgpu_vm_handle_fault(adev, entry->pasid, 
entry->vmid, node_id,
-                                                  addr, entry->timestamp, 
write_fault))
-                               return 1;
-               }
+               int ret = amdgpu_gmc_handle_retry_fault(adev, entry, addr, 
cam_index, node_id,
+                                                       write_fault);
+               /* Returning 1 here also prevents sending the IV to the KFD */
+               if (ret == 1)
+                       return 1;
        }
if (kgd2kfd_vmfault_fast_path(adev, entry, retry_fault))

Reviewed-by: Tvrtko Ursulin <[email protected]>

Regards,

Tvrtko

Reply via email to