From: Chris Wilson Date: Tue, 19 May 2020 06:31:13 +0000 (+0100) Subject: drm/i915/selftests: Change priority overflow detection X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ad6586850b6d718b1245bad6702028c1c773cfb9;p=linux.git drm/i915/selftests: Change priority overflow detection Check for integer overflow in the priority chain, rather than against a type-constricted max-priority check. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala Link: https://patchwork.freedesktop.org/patch/msgid/20200519063123.20673-2-chris@chris-wilson.co.uk --- diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 94854a467e666..3e042fa4b94bc 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -2735,12 +2735,12 @@ static int live_preempt_gang(void *arg) /* Submit each spinner at increasing priority */ engine->schedule(rq, &attr); + if (prio < attr.priority) + break; + if (prio <= I915_PRIORITY_MAX) continue; - if (prio > (INT_MAX >> I915_USER_PRIORITY_SHIFT)) - break; - if (__igt_timeout(end_time, NULL)) break; } while (1);