Skip to content

Commit 77cbe92

Browse files
committed
drm/i915/selftests: Fix error checking for wait_var_timeout
The old wait_on_atomic_t used a custom callback to perform the schedule(), which used my return semantics of reporting an error code on timeout. wait_var_event_timeout() uses the schedule() return semantics of reporting the remaining jiffies (1 if it timed out with 0 jiffies remaining!) and 0 on failure. This semantic mismatch lead to us falsely claiming a time out occurred. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106085 Fixes: d224985 ("sched/wait, drivers/drm: Convert wait_on_atomic_t() usage to the new wait_var_event() API") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180417170638.20550-1-chris@chris-wilson.co.uk
1 parent f425d08 commit 77cbe92

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,11 @@ static int igt_wakeup(void *arg)
412412
* that they are ready for the next test. We wait until all
413413
* threads are complete and waiting for us (i.e. not a seqno).
414414
*/
415-
err = wait_var_event_timeout(&done, !atomic_read(&done), 10 * HZ);
416-
if (err) {
415+
if (!wait_var_event_timeout(&done,
416+
!atomic_read(&done), 10 * HZ)) {
417417
pr_err("Timed out waiting for %d remaining waiters\n",
418418
atomic_read(&done));
419+
err = -ETIMEDOUT;
419420
break;
420421
}
421422

0 commit comments

Comments
 (0)