Skip to content

Commit

Permalink
drm/i915/gt: Use proper sleeping functions for timeouts shorter than …
Browse files Browse the repository at this point in the history
…20ms

msleep is very imprecise for timeouts shorter than 20
milliseconds and most probably will sleep longer. Use
uslee_range() instead.

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250314021225.11813-5-andi.shyti@linux.intel.com
  • Loading branch information
Andi Shyti committed Mar 19, 2025
1 parent 5bebf80 commit 5ba97b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/gt/selftest_rc6.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ int live_rc6_manual(void *arg)

/* Force RC6 off for starters */
__intel_rc6_disable(rc6);
msleep(1); /* wakeup is not immediate, takes about 100us on icl */
/* wakeup is not immediate, takes about 100us on icl */
usleep_range(1000, 2000);

res[0] = rc6_residency(rc6);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gt/selftest_tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pte_tlbinv(struct intel_context *ce,
if (ce->engine->class == OTHER_CLASS)
msleep(200);
else
msleep(10);
usleep_range(10000, 20000);

if (va == vb) {
if (!i915_request_completed(rq)) {
Expand Down

0 comments on commit 5ba97b5

Please sign in to comment.