All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Don't wait forever in drop_caches
@ 2022-11-01 23:50 ` John.C.Harrison
  0 siblings, 0 replies; 30+ messages in thread
From: John.C.Harrison @ 2022-11-01 23:50 UTC (permalink / raw)
  To: Intel-GFX; +Cc: John Harrison, DRI-Devel

From: John Harrison <John.C.Harrison@Intel.com>

At the end of each test, IGT does a drop caches call via sysfs with
special flags set. One of the possible paths waits for idle with an
infinite timeout. That causes problems for debugging issues when CI
catches a "can't go idle" test failure. Best case, the CI system times
out (after 90s), attempts a bunch of state dump actions and then
reboots the system to recover it. Worst case, the CI system can't do
anything at all and then times out (after 1000s) and simply reboots.
Sometimes a serial port log of dmesg might be available, sometimes not.

So rather than making life hard for ourselves, change the timeout to
be 10s rather than infinite. Also, trigger the standard
wedge/reset/recover sequence so that testing can continue with a
working system (if possible).

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index ae987e92251dd..9d916fbbfc27c 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -641,6 +641,9 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_perf_noa_delay_fops,
 		  DROP_RESET_ACTIVE | \
 		  DROP_RESET_SEQNO | \
 		  DROP_RCU)
+
+#define DROP_IDLE_TIMEOUT	(HZ * 10)
+
 static int
 i915_drop_caches_get(void *data, u64 *val)
 {
@@ -661,7 +664,9 @@ gt_drop_caches(struct intel_gt *gt, u64 val)
 		intel_gt_retire_requests(gt);
 
 	if (val & (DROP_IDLE | DROP_ACTIVE)) {
-		ret = intel_gt_wait_for_idle(gt, MAX_SCHEDULE_TIMEOUT);
+		ret = intel_gt_wait_for_idle(gt, DROP_IDLE_TIMEOUT);
+		if (ret == -ETIME)
+			intel_gt_set_wedged(gt);
 		if (ret)
 			return ret;
 	}
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-11-10  6:20 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 23:50 [PATCH] drm/i915: Don't wait forever in drop_caches John.C.Harrison
2022-11-01 23:50 ` [Intel-gfx] " John.C.Harrison
2022-11-02  0:10 ` [Intel-gfx] ✗ Fi.CI.DOCS: warning for " Patchwork
2022-11-02  0:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-11-02  9:13 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-11-02 12:12 ` [PATCH] " Jani Nikula
2022-11-02 12:12   ` [Intel-gfx] " Jani Nikula
2022-11-02 14:20   ` Tvrtko Ursulin
2022-11-03  1:33     ` John Harrison
2022-11-03  9:18       ` Tvrtko Ursulin
2022-11-03  9:38         ` Tvrtko Ursulin
2022-11-03 19:16           ` John Harrison
2022-11-04 10:01             ` Tvrtko Ursulin
2022-11-04 17:45               ` John Harrison
2022-11-04 17:45                 ` John Harrison
2022-11-07 14:09                 ` Tvrtko Ursulin
2022-11-07 14:09                   ` Tvrtko Ursulin
2022-11-07 19:45                   ` John Harrison
2022-11-07 19:45                     ` John Harrison
2022-11-08  9:08                     ` Tvrtko Ursulin
2022-11-08  9:08                       ` Tvrtko Ursulin
2022-11-08 19:37                       ` John Harrison
2022-11-08 19:37                         ` John Harrison
2022-11-09 11:35                         ` Tvrtko Ursulin
2022-11-09 11:35                           ` Tvrtko Ursulin
2022-11-10  6:20                           ` John Harrison
2022-11-10  6:20                             ` John Harrison
2022-11-03 19:37         ` John Harrison
2022-11-03 10:45       ` Jani Nikula
2022-11-03 19:39         ` John Harrison

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.