diff mbox

[1/2] drm/i915: timespec_sub should already be normalized

Message ID 1406664870-29970-1-git-send-email-benjamin.widawsky@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky July 29, 2014, 8:14 p.m. UTC
So don't bother checking it again.
This was introduced:
commit b361237bcc7cea1d99f770490120d8bc2aed7777
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 24 09:35:08 2012 +0100

    drm/i915: Juggle code order to ease flow of the next patch

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Chris Wilson July 30, 2014, 6:15 a.m. UTC | #1
On Tue, Jul 29, 2014 at 01:14:29PM -0700, Ben Widawsky wrote:
> So don't bother checking it again.
> This was introduced:
> commit b361237bcc7cea1d99f770490120d8bc2aed7777
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date:   Fri Aug 24 09:35:08 2012 +0100
> 
>     drm/i915: Juggle code order to ease flow of the next patch
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

Ah, it is not so much that the timeout may be unnormalized, but that it
*may* be negative.
-Chris
Ben Widawsky July 30, 2014, 6:29 a.m. UTC | #2
On Wed, Jul 30, 2014 at 07:15:05AM +0100, Chris Wilson wrote:
> On Tue, Jul 29, 2014 at 01:14:29PM -0700, Ben Widawsky wrote:
> > So don't bother checking it again.
> > This was introduced:
> > commit b361237bcc7cea1d99f770490120d8bc2aed7777
> > Author: Chris Wilson <chris@chris-wilson.co.uk>
> > Date:   Fri Aug 24 09:35:08 2012 +0100
> > 
> >     drm/i915: Juggle code order to ease flow of the next patch
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> 
> Ah, it is not so much that the timeout may be unnormalized, but that it
> *may* be negative.
> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

From looking at the code, I thought it didn't matter (ie. I thought it
dtrt regardless of negative). However, I just wrote a little test, and
you are correct. It is needed. Sorry about that.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ac349ff..17f7ac9 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1243,8 +1243,6 @@  static int __wait_seqno(struct intel_engine_cs *ring, u32 seqno,
 	if (timeout) {
 		struct timespec sleep_time = timespec_sub(now, before);
 		*timeout = timespec_sub(*timeout, sleep_time);
-		if (!timespec_valid(timeout)) /* i.e. negative time remains */
-			set_normalized_timespec(timeout, 0, 0);
 	}
 
 	return ret;