From: Andi Shyti <andi.shyti@linux.intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: Andi Shyti <andi.shyti@linux.intel.com>,
Andi Shyti <andi.shyti@kernel.org>
Subject: [PATCH 4/4] drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms
Date: Fri, 14 Mar 2025 03:12:24 +0100 [thread overview]
Message-ID: <20250314021225.11813-5-andi.shyti@linux.intel.com> (raw)
In-Reply-To: <20250314021225.11813-1-andi.shyti@linux.intel.com>
msleep is very unprecise 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>
---
drivers/gpu/drm/i915/gt/selftest_rc6.c | 3 ++-
drivers/gpu/drm/i915/gt/selftest_tlb.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c b/drivers/gpu/drm/i915/gt/selftest_rc6.c
index 908483ab0bc8..99de5d85a096 100644
--- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
+++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
@@ -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);
diff --git a/drivers/gpu/drm/i915/gt/selftest_tlb.c b/drivers/gpu/drm/i915/gt/selftest_tlb.c
index 3941f2d6fa47..69ed946a39e5 100644
--- a/drivers/gpu/drm/i915/gt/selftest_tlb.c
+++ b/drivers/gpu/drm/i915/gt/selftest_tlb.c
@@ -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)) {
--
2.47.2
next prev parent reply other threads:[~2025-03-14 2:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 2:12 [PATCH 0/4] Trivial style fixes Andi Shyti
2025-03-14 2:12 ` [PATCH 1/4] drm/i915/gt: Fix typos in comments Andi Shyti
2025-03-14 13:37 ` Sebastian Brzezinka
2025-03-14 13:41 ` Andi Shyti
2025-03-14 2:12 ` [PATCH 2/4] drm/i915/gt: Fix SPDX license format Andi Shyti
2025-03-18 10:55 ` Krzysztof Karas
2025-03-19 0:34 ` Andi Shyti
2025-03-20 7:38 ` Gote, Nitin R
2025-03-14 2:12 ` [PATCH 3/4] drm/i915/gt: Remove trailing blank lines Andi Shyti
2025-03-20 6:59 ` Gote, Nitin R
2025-03-14 2:12 ` Andi Shyti [this message]
2025-03-20 6:54 ` [PATCH 4/4] drm/i915/gt: Use proper sleeping functions for timeouts shorter than 20ms Gote, Nitin R
2025-03-14 4:05 ` ✗ Fi.CI.CHECKPATCH: warning for Trivial style fixes Patchwork
2025-03-14 4:05 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-03-14 12:10 ` [PATCH 0/4] " Sebastian Brzezinka
2025-03-18 11:04 ` Krzysztof Karas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250314021225.11813-5-andi.shyti@linux.intel.com \
--to=andi.shyti@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox