Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/4] drm/i915: avoid premature timeouts in __wait_seqno()
Date: Tue, 21 May 2013 20:03:19 +0300	[thread overview]
Message-ID: <1369155800-19654-3-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1369155800-19654-1-git-send-email-imre.deak@intel.com>

At the moment wait_event_timeout/wait_event_interruptible_timeout may
time out 1 jiffy too early, as the calculated expiry time is 1 less than
needed. Besides timing out too early this also means that the
calculation of the remaining time will be incorrect and we will pass a
non-zero remaining time to user space in case of a time out. This is one
reason for the following bugzilla report:

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64270

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index a1a282c..2b51fa7 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1003,7 +1003,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 		wait_forever = false;
 	}
 
-	timeout_jiffies = timespec_to_jiffies(&wait_time);
+	timeout_jiffies = timespec_to_jiffies_timeout(&wait_time);
 
 	if (WARN_ON(!ring->irq_get(ring)))
 		return -ENODEV;
-- 
1.8.1.2

  parent reply	other threads:[~2013-05-21 17:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 17:03 [PATCH 1/4] drm/i915: add msecs_to_jiffies_timeout to guarantee minimum duration Imre Deak
2013-05-21 17:03 ` [PATCH 2/4] drm/i915: use msecs_to_jiffies_timeout instead of open coding the same Imre Deak
2013-05-21 17:20   ` Daniel Vetter
2013-05-21 18:00     ` Imre Deak
2013-05-21 18:20       ` Daniel Vetter
2013-05-21 17:03 ` Imre Deak [this message]
2013-05-21 17:03 ` [PATCH 4/4] drm/i915: avoid premature DP AUX timeouts Imre Deak
2013-05-22  7:48 ` [PATCH 1/4] drm/i915: add msecs_to_jiffies_timeout to guarantee minimum duration Jani Nikula
2013-05-22  9:46   ` Daniel Vetter
2013-05-22  9:57     ` Imre Deak
2013-05-22 11:51       ` Daniel Vetter

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=1369155800-19654-3-git-send-email-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --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