Skip to content

Commit 603b9a5

Browse files
Tim Huangalexdeucher
authored andcommitted
drm/amdgpu: skip fence GFX interrupts disable/enable for S0ix
GFX v11.0.1 reported fence fallback timer expired issue on SDMA and GFX rings after S0ix resume. This is generated by EOP interrupts are disabled when S0ix suspend but fails to re-enable when resume because of the GFX is in GFXOFF. [ 203.349571] [drm] Fence fallback timer expired on ring sdma0 [ 203.349572] [drm] Fence fallback timer expired on ring gfx_0.0.0 [ 203.861635] [drm] Fence fallback timer expired on ring gfx_0.0.0 For S0ix, GFX is in GFXOFF state, avoid to touch the GFX registers to configure the fence driver interrupts for rings that belong to GFX. The interrupts configuration will be restored by GFXOFF exit. Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b5cdade commit 603b9a5

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,41 @@ int amdgpu_fence_driver_sw_init(struct amdgpu_device *adev)
551551
return 0;
552552
}
553553

554+
/**
555+
* amdgpu_fence_need_ring_interrupt_restore - helper function to check whether
556+
* fence driver interrupts need to be restored.
557+
*
558+
* @ring: ring that to be checked
559+
*
560+
* Interrupts for rings that belong to GFX IP don't need to be restored
561+
* when the target power state is s0ix.
562+
*
563+
* Return true if need to restore interrupts, false otherwise.
564+
*/
565+
static bool amdgpu_fence_need_ring_interrupt_restore(struct amdgpu_ring *ring)
566+
{
567+
struct amdgpu_device *adev = ring->adev;
568+
bool is_gfx_power_domain = false;
569+
570+
switch (ring->funcs->type) {
571+
case AMDGPU_RING_TYPE_SDMA:
572+
/* SDMA 5.x+ is part of GFX power domain so it's covered by GFXOFF */
573+
if (adev->ip_versions[SDMA0_HWIP][0] >= IP_VERSION(5, 0, 0))
574+
is_gfx_power_domain = true;
575+
break;
576+
case AMDGPU_RING_TYPE_GFX:
577+
case AMDGPU_RING_TYPE_COMPUTE:
578+
case AMDGPU_RING_TYPE_KIQ:
579+
case AMDGPU_RING_TYPE_MES:
580+
is_gfx_power_domain = true;
581+
break;
582+
default:
583+
break;
584+
}
585+
586+
return !(adev->in_s0ix && is_gfx_power_domain);
587+
}
588+
554589
/**
555590
* amdgpu_fence_driver_hw_fini - tear down the fence driver
556591
* for all possible rings.
@@ -579,7 +614,8 @@ void amdgpu_fence_driver_hw_fini(struct amdgpu_device *adev)
579614
amdgpu_fence_driver_force_completion(ring);
580615

581616
if (!drm_dev_is_unplugged(adev_to_drm(adev)) &&
582-
ring->fence_drv.irq_src)
617+
ring->fence_drv.irq_src &&
618+
amdgpu_fence_need_ring_interrupt_restore(ring))
583619
amdgpu_irq_put(adev, ring->fence_drv.irq_src,
584620
ring->fence_drv.irq_type);
585621

@@ -655,7 +691,8 @@ void amdgpu_fence_driver_hw_init(struct amdgpu_device *adev)
655691
continue;
656692

657693
/* enable the interrupt */
658-
if (ring->fence_drv.irq_src)
694+
if (ring->fence_drv.irq_src &&
695+
amdgpu_fence_need_ring_interrupt_restore(ring))
659696
amdgpu_irq_get(adev, ring->fence_drv.irq_src,
660697
ring->fence_drv.irq_type);
661698
}

0 commit comments

Comments
 (0)