@@ -221,7 +221,7 @@ static int __live_parallel_switch1(void *data)
return err;
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
pr_info("%s: %lu switches (sync)\n", arg->ce[0]->engine->name, count);
return 0;
@@ -262,7 +262,7 @@ static int __live_parallel_switchN(void *data)
}
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
i915_request_put(rq);
pr_info("%s: %lu switches (many)\n", arg->ce[0]->engine->name, count);
@@ -3558,7 +3558,8 @@ static int smoke_crescendo_thread(void *arg)
return err;
count++;
- } while (count < smoke->ncontext && !__igt_timeout(end_time, NULL));
+ } while (count < smoke->ncontext &&
+ !__igt_thread_timeout(end_time, NULL));
smoke->count = count;
return 0;
@@ -131,6 +131,8 @@ static inline int i915_perf_selftests(struct pci_dev *pdev) { return 0; }
__printf(2, 3)
bool __igt_timeout(unsigned long timeout, const char *fmt, ...);
+__printf(2, 3)
+bool __igt_thread_timeout(unsigned long timeout, const char *fmt, ...);
#define igt_timeout(t, fmt, ...) \
__igt_timeout((t), KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
@@ -1467,7 +1467,7 @@ static int __live_parallel_engine1(void *arg)
break;
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
intel_engine_pm_put(engine);
pr_info("%s: %lu request + sync\n", engine->name, count);
@@ -1496,7 +1496,7 @@ static int __live_parallel_engineN(void *arg)
i915_request_add(rq);
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
intel_engine_pm_put(engine);
pr_info("%s: %lu requests\n", engine->name, count);
@@ -2978,7 +2978,7 @@ static int p_sync0(void *arg)
break;
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
if (busy) {
ktime_t now;
@@ -3053,7 +3053,7 @@ static int p_sync1(void *arg)
break;
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
i915_request_put(prev);
if (busy) {
@@ -3118,7 +3118,7 @@ static int p_many(void *arg)
i915_request_add(rq);
count++;
- } while (!__igt_timeout(end_time, NULL));
+ } while (!__igt_thread_timeout(end_time, NULL));
if (busy) {
ktime_t now;
@@ -397,6 +397,24 @@ bool __igt_timeout(unsigned long timeout, const char *fmt, ...)
return true;
}
+
+bool __igt_thread_timeout(unsigned long timeout, const char *fmt, ...)
+{
+ va_list va;
+
+ cond_resched();
+ if (time_before(jiffies, timeout))
+ return false;
+
+ if (fmt) {
+ va_start(va, fmt);
+ vprintk(fmt, va);
+ va_end(va);
+ }
+
+ return true;
+}
+
void igt_hexdump(const void *buf, size_t len)
{
const size_t rowsize = 8 * sizeof(u32);