Skip to content

Commit 617e87c

Browse files
drm/i915/selftest: Fix hangcheck self test for GuC submission
When GuC submission is enabled, the GuC controls engine resets. Rather than explicitly triggering a reset, the driver must submit a hanging context to GuC and wait for the reset to occur. Conversely, one of the tests specifically sends hanging batches to the engines but wants them to sit around until a manual reset of the full GT (including GuC itself). That means disabling GuC based engine resets to prevent those from killing the hanging batch too soon. So, add support to the scheduling policy helper for disabling resets as well as making them quicker! In GuC submission mode, the 'is engine idle' test basically turns into 'is engine PM wakelock held'. Independently, there is a heartbeat disable helper function that the tests use. For unexplained reasons, this acquires the engine wakelock before disabling the heartbeat and only releases it when re-enabling the heartbeat. As one of the tests tries to do a wait for idle in the middle of a heartbeat disabled section, it is therefore guaranteed to always fail. Added a 'no_pm' variant of the heartbeat helper that allows the engine to be asleep while also having heartbeats disabled. Signed-off-by: John Harrison <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Matthew Brost <[email protected]> Signed-off-by: John Harrison <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 716c61c commit 617e87c

File tree

7 files changed

+236
-71
lines changed

7 files changed

+236
-71
lines changed

drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,25 @@ void st_engine_heartbeat_enable(struct intel_engine_cs *engine)
405405
engine->props.heartbeat_interval_ms =
406406
engine->defaults.heartbeat_interval_ms;
407407
}
408+
409+
void st_engine_heartbeat_disable_no_pm(struct intel_engine_cs *engine)
410+
{
411+
engine->props.heartbeat_interval_ms = 0;
412+
413+
/*
414+
* Park the heartbeat but without holding the PM lock as that
415+
* makes the engines appear not-idle. Note that if/when unpark
416+
* is called due to the PM lock being acquired later the
417+
* heartbeat still won't be enabled because of the above = 0.
418+
*/
419+
if (intel_engine_pm_get_if_awake(engine)) {
420+
intel_engine_park_heartbeat(engine);
421+
intel_engine_pm_put(engine);
422+
}
423+
}
424+
425+
void st_engine_heartbeat_enable_no_pm(struct intel_engine_cs *engine)
426+
{
427+
engine->props.heartbeat_interval_ms =
428+
engine->defaults.heartbeat_interval_ms;
429+
}

drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
struct intel_engine_cs;
1010

1111
void st_engine_heartbeat_disable(struct intel_engine_cs *engine);
12+
void st_engine_heartbeat_disable_no_pm(struct intel_engine_cs *engine);
1213
void st_engine_heartbeat_enable(struct intel_engine_cs *engine);
14+
void st_engine_heartbeat_enable_no_pm(struct intel_engine_cs *engine);
1315

1416
#endif /* SELFTEST_ENGINE_HEARTBEAT_H */

0 commit comments

Comments
 (0)