@@ -621,6 +621,9 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_perf_noa_delay_fops,
i915_perf_noa_delay_set,
"%llu\n");
+#define DROPCACHE_IDLE_ENGINES_TIMEOUT_MS 200
+#define DROPCACHE_IDLE_GT_TIMEOUT (HZ * 10)
+
#define DROP_UNBOUND BIT(0)
#define DROP_BOUND BIT(1)
#define DROP_RETIRE BIT(2)
@@ -641,6 +644,7 @@ DEFINE_SIMPLE_ATTRIBUTE(i915_perf_noa_delay_fops,
DROP_RESET_ACTIVE | \
DROP_RESET_SEQNO | \
DROP_RCU)
+
static int
i915_drop_caches_get(void *data, u64 *val)
{
@@ -654,14 +658,16 @@ gt_drop_caches(struct intel_gt *gt, u64 val)
int ret;
if (val & DROP_RESET_ACTIVE &&
- wait_for(intel_engines_are_idle(gt), I915_IDLE_ENGINES_TIMEOUT))
+ wait_for(intel_engines_are_idle(gt), DROPCACHE_IDLE_ENGINES_TIMEOUT_MS))
intel_gt_set_wedged(gt);
if (val & DROP_RETIRE)
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, DROPCACHE_IDLE_GT_TIMEOUT);
+ if (ret == -ETIME)
+ intel_gt_set_wedged(gt);
if (ret)
return ret;
}
@@ -162,8 +162,6 @@ struct i915_gem_mm {
u32 shrink_count;
};
-#define I915_IDLE_ENGINES_TIMEOUT (200) /* in ms */
-
unsigned long i915_fence_context_timeout(const struct drm_i915_private *i915,
u64 context);