[Intel-gfx] [PATCH] drm/i915/gt: Flush the old heartbeat on interval change

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 16 13:08:31 UTC 2020


To try and avoid too rapid change causing premature heart attacks, let
us flush the old heartbeat before changing the interval.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
index 9060385cd69e..cb67ac2a1757 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
@@ -208,11 +208,9 @@ static unsigned long set_heartbeat(struct intel_engine_cs *engine,
 {
 	unsigned long old;
 
+	intel_engine_park_heartbeat(engine);
 	old = xchg(&engine->props.heartbeat_interval_ms, delay);
-	if (delay)
-		intel_engine_unpark_heartbeat(engine);
-	else
-		intel_engine_park_heartbeat(engine);
+	intel_engine_unpark_heartbeat(engine);
 
 	return old;
 }
-- 
2.20.1



More information about the Intel-gfx mailing list