Skip to content

Commit 26d2b75

Browse files
jkrzyszt-inteljlahtine-intel
authored andcommitted
drm/i915/selftests: Fix dependency of some timeouts on HZ
Third argument of i915_request_wait() accepts a timeout value in jiffies. Most users pass either a simple HZ based expression, or a result of msecs_to_jiffies(), or MAX_SCHEDULE_TIMEOUT, or a very small number not exceeding 4 if applicable as that value. However, there is one user -- intel_selftest_wait_for_rq() -- that passes a WAIT_FOR_RESET_TIME symbol, defined as a large constant value that most probably represents a desired timeout in ms. While that usage results in the intended value of timeout on usual x86_64 kernel configurations, it is not portable across different architectures and custom kernel configs. Rename the symbol to clearly indicate intended units and convert it to jiffies before use. Fixes: 3a4bfa0 ("drm/i915/selftest: Fix workarounds selftest for GuC submission") Signed-off-by: Janusz Krzysztofik <[email protected]> Cc: Rahul Kumar Singh <[email protected]> Cc: John Harrison <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 6ee3f54) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 0b385be commit 26d2b75

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © 2021 Intel Corporation
44
*/
55

6+
#include <linux/jiffies.h>
7+
68
//#include "gt/intel_engine_user.h"
79
#include "gt/intel_gt.h"
810
#include "i915_drv.h"
@@ -12,7 +14,7 @@
1214

1315
#define REDUCED_TIMESLICE 5
1416
#define REDUCED_PREEMPT 10
15-
#define WAIT_FOR_RESET_TIME 10000
17+
#define WAIT_FOR_RESET_TIME_MS 10000
1618

1719
struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt)
1820
{
@@ -91,7 +93,7 @@ int intel_selftest_wait_for_rq(struct i915_request *rq)
9193
{
9294
long ret;
9395

94-
ret = i915_request_wait(rq, 0, WAIT_FOR_RESET_TIME);
96+
ret = i915_request_wait(rq, 0, msecs_to_jiffies(WAIT_FOR_RESET_TIME_MS));
9597
if (ret < 0)
9698
return ret;
9799

0 commit comments

Comments
 (0)