public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/selftests: Wait for the dma-fence timeout
@ 2018-01-17 12:15 Chris Wilson
  2018-01-17 12:27 ` Tvrtko Ursulin
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 12:15 UTC (permalink / raw)
  To: intel-gfx

When testing that the timeout fired, we need to be sure we have waited
just long enough for the timeout to have occurred and for the softirq
(on another cpu) to have completed. Sleeping for an arbitrary amount is
prone to error, so wait for the timeout instead and complain if it was
too late.

References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 30 +++++++++-----------------
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
index 4fb51deb81a1..f171db16a1c4 100644
--- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
@@ -661,7 +661,7 @@ static int test_dma_fence(void *arg)
 {
 	struct i915_sw_fence *timeout = NULL, *not = NULL;
 	unsigned long delay = i915_selftest.timeout_jiffies;
-	unsigned long end, sleep;
+	unsigned long start, end;
 	struct dma_fence *dma;
 	int err;
 
@@ -688,36 +688,26 @@ static int test_dma_fence(void *arg)
 	}
 
 	/* We round the timeout for the fence up to the next second */
-	end = round_jiffies_up(jiffies + delay);
+	start = jiffies;
+	end = round_jiffies_up(start + delay);
 
-	sleep = jiffies_to_usecs(delay) / 3;
-	usleep_range(sleep, 2 * sleep);
-	if (time_after(jiffies, end)) {
-		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
-		goto skip;
+	if (wait_event_interruptible(timeout->wait,
+				     i915_sw_fence_done(timeout))) {
+		err = -EINTR;
+		goto err;
 	}
 
-	if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
-		pr_err("Fences signaled too early\n");
+	if (time_after(jiffies, 2*end - start)) {
+		pr_err("Timeout (now %lu) later than expected (%lu)\n",
+		       jiffies, end);
 		goto err;
 	}
 
-	do {
-		sleep = jiffies_to_usecs(end - jiffies + 1);
-		usleep_range(sleep, 2 * sleep);
-	} while (!time_after(jiffies, end));
-
 	if (i915_sw_fence_done(not)) {
 		pr_err("No timeout fence signaled!\n");
 		goto err;
 	}
 
-	if (!i915_sw_fence_done(timeout)) {
-		pr_err("Timeout fence unsignaled!\n");
-		goto err;
-	}
-
-skip:
 	dma_fence_signal(dma);
 
 	if (!i915_sw_fence_done(timeout) || !i915_sw_fence_done(not)) {
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
@ 2018-01-17 12:27 ` Tvrtko Ursulin
  2018-01-17 12:44   ` Chris Wilson
  2018-01-17 13:11 ` [PATCH v2] " Chris Wilson
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Tvrtko Ursulin @ 2018-01-17 12:27 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 17/01/2018 12:15, Chris Wilson wrote:
> When testing that the timeout fired, we need to be sure we have waited
> just long enough for the timeout to have occurred and for the softirq
> (on another cpu) to have completed. Sleeping for an arbitrary amount is
> prone to error, so wait for the timeout instead and complain if it was
> too late.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 30 +++++++++-----------------
>   1 file changed, 10 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index 4fb51deb81a1..f171db16a1c4 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> @@ -661,7 +661,7 @@ static int test_dma_fence(void *arg)
>   {
>   	struct i915_sw_fence *timeout = NULL, *not = NULL;
>   	unsigned long delay = i915_selftest.timeout_jiffies;
> -	unsigned long end, sleep;
> +	unsigned long start, end;
>   	struct dma_fence *dma;
>   	int err;
>   
> @@ -688,36 +688,26 @@ static int test_dma_fence(void *arg)
>   	}
>   
>   	/* We round the timeout for the fence up to the next second */
> -	end = round_jiffies_up(jiffies + delay);
> +	start = jiffies;
> +	end = round_jiffies_up(start + delay);
>   
> -	sleep = jiffies_to_usecs(delay) / 3;
> -	usleep_range(sleep, 2 * sleep);
> -	if (time_after(jiffies, end)) {
> -		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> -		goto skip;
> +	if (wait_event_interruptible(timeout->wait,
> +				     i915_sw_fence_done(timeout))) {
> +		err = -EINTR;
> +		goto err;

But can now hang forever if broken.

How about short sleeps in a loop until a timeout?

Regards,

Tvrtko

>   	}
>   
> -	if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
> -		pr_err("Fences signaled too early\n");
> +	if (time_after(jiffies, 2*end - start)) {
> +		pr_err("Timeout (now %lu) later than expected (%lu)\n",
> +		       jiffies, end);
>   		goto err;
>   	}
>   
> -	do {
> -		sleep = jiffies_to_usecs(end - jiffies + 1);
> -		usleep_range(sleep, 2 * sleep);
> -	} while (!time_after(jiffies, end));
> -
>   	if (i915_sw_fence_done(not)) {
>   		pr_err("No timeout fence signaled!\n");
>   		goto err;
>   	}
>   
> -	if (!i915_sw_fence_done(timeout)) {
> -		pr_err("Timeout fence unsignaled!\n");
> -		goto err;
> -	}
> -
> -skip:
>   	dma_fence_signal(dma);
>   
>   	if (!i915_sw_fence_done(timeout) || !i915_sw_fence_done(not)) {
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:27 ` Tvrtko Ursulin
@ 2018-01-17 12:44   ` Chris Wilson
  2018-01-17 12:54     ` Tvrtko Ursulin
  0 siblings, 1 reply; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 12:44 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-01-17 12:27:50)
> 
> On 17/01/2018 12:15, Chris Wilson wrote:
> > When testing that the timeout fired, we need to be sure we have waited
> > just long enough for the timeout to have occurred and for the softirq
> > (on another cpu) to have completed. Sleeping for an arbitrary amount is
> > prone to error, so wait for the timeout instead and complain if it was
> > too late.
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 30 +++++++++-----------------
> >   1 file changed, 10 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > index 4fb51deb81a1..f171db16a1c4 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > @@ -661,7 +661,7 @@ static int test_dma_fence(void *arg)
> >   {
> >       struct i915_sw_fence *timeout = NULL, *not = NULL;
> >       unsigned long delay = i915_selftest.timeout_jiffies;
> > -     unsigned long end, sleep;
> > +     unsigned long start, end;
> >       struct dma_fence *dma;
> >       int err;
> >   
> > @@ -688,36 +688,26 @@ static int test_dma_fence(void *arg)
> >       }
> >   
> >       /* We round the timeout for the fence up to the next second */
> > -     end = round_jiffies_up(jiffies + delay);
> > +     start = jiffies;
> > +     end = round_jiffies_up(start + delay);
> >   
> > -     sleep = jiffies_to_usecs(delay) / 3;
> > -     usleep_range(sleep, 2 * sleep);
> > -     if (time_after(jiffies, end)) {
> > -             pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> > -             goto skip;
> > +     if (wait_event_interruptible(timeout->wait,
> > +                                  i915_sw_fence_done(timeout))) {
> > +             err = -EINTR;
> > +             goto err;
> 
> But can now hang forever if broken.

Which is why I allowed it to be interrupted. Maybe wait_event_killable()?

> How about short sleeps in a loop until a timeout?

I kind of like the idea of using the waitqueue now :)

How about if I attach a timer to kick the waitqueue instead.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:44   ` Chris Wilson
@ 2018-01-17 12:54     ` Tvrtko Ursulin
  0 siblings, 0 replies; 18+ messages in thread
From: Tvrtko Ursulin @ 2018-01-17 12:54 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 17/01/2018 12:44, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-01-17 12:27:50)
>>
>> On 17/01/2018 12:15, Chris Wilson wrote:
>>> When testing that the timeout fired, we need to be sure we have waited
>>> just long enough for the timeout to have occurred and for the softirq
>>> (on another cpu) to have completed. Sleeping for an arbitrary amount is
>>> prone to error, so wait for the timeout instead and complain if it was
>>> too late.
>>>
>>> References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> ---
>>>    drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 30 +++++++++-----------------
>>>    1 file changed, 10 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
>>> index 4fb51deb81a1..f171db16a1c4 100644
>>> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
>>> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
>>> @@ -661,7 +661,7 @@ static int test_dma_fence(void *arg)
>>>    {
>>>        struct i915_sw_fence *timeout = NULL, *not = NULL;
>>>        unsigned long delay = i915_selftest.timeout_jiffies;
>>> -     unsigned long end, sleep;
>>> +     unsigned long start, end;
>>>        struct dma_fence *dma;
>>>        int err;
>>>    
>>> @@ -688,36 +688,26 @@ static int test_dma_fence(void *arg)
>>>        }
>>>    
>>>        /* We round the timeout for the fence up to the next second */
>>> -     end = round_jiffies_up(jiffies + delay);
>>> +     start = jiffies;
>>> +     end = round_jiffies_up(start + delay);
>>>    
>>> -     sleep = jiffies_to_usecs(delay) / 3;
>>> -     usleep_range(sleep, 2 * sleep);
>>> -     if (time_after(jiffies, end)) {
>>> -             pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
>>> -             goto skip;
>>> +     if (wait_event_interruptible(timeout->wait,
>>> +                                  i915_sw_fence_done(timeout))) {
>>> +             err = -EINTR;
>>> +             goto err;
>>
>> But can now hang forever if broken.
> 
> Which is why I allowed it to be interrupted. Maybe wait_event_killable()?
> 
>> How about short sleeps in a loop until a timeout?
> 
> I kind of like the idea of using the waitqueue now :)
> 
> How about if I attach a timer to kick the waitqueue instead.

I would hate to be the trigger of overkills. But I think it is nice if 
the test times out on it's own. So either option is fine by me. (Short 
sleep polling loop, or timer kick with timeout checking.)

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v2] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
  2018-01-17 12:27 ` Tvrtko Ursulin
@ 2018-01-17 13:11 ` Chris Wilson
  2018-01-17 13:36   ` Tvrtko Ursulin
  2018-01-17 13:15 ` [PATCH v3] " Chris Wilson
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 13:11 UTC (permalink / raw)
  To: intel-gfx

When testing that the timeout fired, we need to be sure we have waited
just long enough for the timeout to have occurred and for the softirq
(on another cpu) to have completed. Sleeping for an arbitrary amount is
prone to error, so wait for the timeout instead and complain if it was
too late.

v2: Use wait_event_timeout to provide an upper bound

References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 27 +++++---------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
index 4fb51deb81a1..301f0ce4cd3c 100644
--- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
@@ -661,7 +661,6 @@ static int test_dma_fence(void *arg)
 {
 	struct i915_sw_fence *timeout = NULL, *not = NULL;
 	unsigned long delay = i915_selftest.timeout_jiffies;
-	unsigned long end, sleep;
 	struct dma_fence *dma;
 	int err;
 
@@ -688,36 +687,20 @@ static int test_dma_fence(void *arg)
 	}
 
 	/* We round the timeout for the fence up to the next second */
-	end = round_jiffies_up(jiffies + delay);
+	delay = round_jiffies_up_relative(delay);
 
-	sleep = jiffies_to_usecs(delay) / 3;
-	usleep_range(sleep, 2 * sleep);
-	if (time_after(jiffies, end)) {
-		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
-		goto skip;
-	}
-
-	if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
-		pr_err("Fences signaled too early\n");
+	if (wait_event_timeout(timeout->wait,
+			       i915_sw_fence_done(timeout),
+			       2 * delay)) {
+		pr_err("Timeout fence unsignaled!\n");
 		goto err;
 	}
 
-	do {
-		sleep = jiffies_to_usecs(end - jiffies + 1);
-		usleep_range(sleep, 2 * sleep);
-	} while (!time_after(jiffies, end));
-
 	if (i915_sw_fence_done(not)) {
 		pr_err("No timeout fence signaled!\n");
 		goto err;
 	}
 
-	if (!i915_sw_fence_done(timeout)) {
-		pr_err("Timeout fence unsignaled!\n");
-		goto err;
-	}
-
-skip:
 	dma_fence_signal(dma);
 
 	if (!i915_sw_fence_done(timeout) || !i915_sw_fence_done(not)) {
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v3] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
  2018-01-17 12:27 ` Tvrtko Ursulin
  2018-01-17 13:11 ` [PATCH v2] " Chris Wilson
@ 2018-01-17 13:15 ` Chris Wilson
  2018-01-17 13:25 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 13:15 UTC (permalink / raw)
  To: intel-gfx

When testing that the timeout fired, we need to be sure we have waited
just long enough for the timeout to have occurred and for the softirq
(on another cpu) to have completed. Sleeping for an arbitrary amount is
prone to error, so wait for the timeout instead and complain if it was
too late.

v2: Use wait_event_timeout to provide an upper bound
v3: Fix inverted check for wait_event_timeout timing out

References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 27 +++++---------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
index 4fb51deb81a1..d75eb97819c1 100644
--- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
@@ -661,7 +661,6 @@ static int test_dma_fence(void *arg)
 {
 	struct i915_sw_fence *timeout = NULL, *not = NULL;
 	unsigned long delay = i915_selftest.timeout_jiffies;
-	unsigned long end, sleep;
 	struct dma_fence *dma;
 	int err;
 
@@ -688,36 +687,20 @@ static int test_dma_fence(void *arg)
 	}
 
 	/* We round the timeout for the fence up to the next second */
-	end = round_jiffies_up(jiffies + delay);
+	delay = round_jiffies_up_relative(delay);
 
-	sleep = jiffies_to_usecs(delay) / 3;
-	usleep_range(sleep, 2 * sleep);
-	if (time_after(jiffies, end)) {
-		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
-		goto skip;
-	}
-
-	if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
-		pr_err("Fences signaled too early\n");
+	if (!wait_event_timeout(timeout->wait,
+				i915_sw_fence_done(timeout),
+				2 * delay)) {
+		pr_err("Timeout fence unsignaled!\n");
 		goto err;
 	}
 
-	do {
-		sleep = jiffies_to_usecs(end - jiffies + 1);
-		usleep_range(sleep, 2 * sleep);
-	} while (!time_after(jiffies, end));
-
 	if (i915_sw_fence_done(not)) {
 		pr_err("No timeout fence signaled!\n");
 		goto err;
 	}
 
-	if (!i915_sw_fence_done(timeout)) {
-		pr_err("Timeout fence unsignaled!\n");
-		goto err;
-	}
-
-skip:
 	dma_fence_signal(dma);
 
 	if (!i915_sw_fence_done(timeout) || !i915_sw_fence_done(not)) {
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (2 preceding siblings ...)
  2018-01-17 13:15 ` [PATCH v3] " Chris Wilson
@ 2018-01-17 13:25 ` Patchwork
  2018-01-17 13:29   ` Saarinen, Jani
  2018-01-17 13:45 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev2) Patchwork
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Patchwork @ 2018-01-17 13:25 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Wait for the dma-fence timeout
URL   : https://patchwork.freedesktop.org/series/36610/
State : success

== Summary ==

Series 36610v1 drm/i915/selftests: Wait for the dma-fence timeout
https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/1/mbox/

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:421s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:427s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:515s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:419s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:465s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:501s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:516s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:492s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:518s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:406s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:473s
fi-bsw-n3050 failed to connect after reboot
fi-byt-j1900 failed to connect after reboot
fi-byt-n2820 failed to connect after reboot
fi-gdg-551 failed to connect after reboot
fi-ilk-650 failed to connect after reboot
fi-pnv-d510 failed to connect after reboot

a5cf4f0319302df5036145fd6c96d6966cc677ae drm-tip: 2018y-01m-17d-09h-14m-44s UTC integration manifest
45d7504b5ec6 drm/i915/selftests: Wait for the dma-fence timeout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7694/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 13:25 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-01-17 13:29   ` Saarinen, Jani
  2018-01-17 13:31     ` Chris Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: Saarinen, Jani @ 2018-01-17 13:29 UTC (permalink / raw)
  To: intel-gfx@lists.freedesktop.org, Chris Wilson, Sarvela, Tomi P

HI, 
> -----Original Message-----
> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> Patchwork
> Sent: keskiviikko 17. tammikuuta 2018 15.26
> To: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the
> dma-fence timeout
> 
> == Series Details ==
> 
> Series: drm/i915/selftests: Wait for the dma-fence timeout
> URL   : https://patchwork.freedesktop.org/series/36610/
> State : success
> 
> == Summary ==
> 
> Series 36610v1 drm/i915/selftests: Wait for the dma-fence timeout
> https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/1/mbox/
> 
> fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:421s
> fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24
> time:427s
> fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
> fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
> fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
> fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
> fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45
> fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:515s
> fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
> fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
> fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:464s
> fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:419s
> fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:465s
> fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:501s
> fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
> fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
> fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
> fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:516s
> fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
> fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:492s
> fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:477s
> fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
> fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:518s
> fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:406s
> Blacklisted hosts:
> fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
> fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:473s
> fi-bsw-n3050 failed to connect after reboot
> fi-byt-j1900 failed to connect after reboot
> fi-byt-n2820 failed to connect after reboot
> fi-gdg-551 failed to connect after reboot
> fi-ilk-650 failed to connect after reboot
> fi-pnv-d510 failed to connect after reboot
These due to series or some other issue? 
> 
> a5cf4f0319302df5036145fd6c96d6966cc677ae drm-tip: 2018y-01m-17d-09h-
> 14m-44s UTC integration manifest
> 45d7504b5ec6 drm/i915/selftests: Wait for the dma-fence timeout
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-
> tip/Patchwork_7694/issues.html
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 13:29   ` Saarinen, Jani
@ 2018-01-17 13:31     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 13:31 UTC (permalink / raw)
  To: Saarinen, Jani, intel-gfx@lists.freedesktop.org, Sarvela, Tomi P

Quoting Saarinen, Jani (2018-01-17 13:29:13)
> HI, 
> > -----Original Message-----
> > From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
> > Patchwork
> > Sent: keskiviikko 17. tammikuuta 2018 15.26
> > To: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: intel-gfx@lists.freedesktop.org
> > Subject: [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the
> > dma-fence timeout
> > 
> > == Series Details ==
> > 
> > Series: drm/i915/selftests: Wait for the dma-fence timeout
> > URL   : https://patchwork.freedesktop.org/series/36610/
> > State : success
> > 
> > == Summary ==
> > 
> > Series 36610v1 drm/i915/selftests: Wait for the dma-fence timeout
> > https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/1/mbox/
> > 
> > fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:421s
> > fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24
> > time:427s
> > fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
> > fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
> > fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
> > fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
> > fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45
> > fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:515s
> > fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
> > fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
> > fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:464s
> > fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:419s
> > fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:465s
> > fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:501s
> > fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
> > fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
> > fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
> > fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:516s
> > fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s
> > fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:492s
> > fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:477s
> > fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
> > fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:518s
> > fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:406s
> > Blacklisted hosts:
> > fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
> > fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:473s
> > fi-bsw-n3050 failed to connect after reboot
> > fi-byt-j1900 failed to connect after reboot
> > fi-byt-n2820 failed to connect after reboot
> > fi-gdg-551 failed to connect after reboot
> > fi-ilk-650 failed to connect after reboot
> > fi-pnv-d510 failed to connect after reboot
> These due to series or some other issue? 

Highly unlikely to be this patch as it only touches code inside
selftests/ which is not run.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 13:11 ` [PATCH v2] " Chris Wilson
@ 2018-01-17 13:36   ` Tvrtko Ursulin
  2018-01-17 13:41     ` Chris Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: Tvrtko Ursulin @ 2018-01-17 13:36 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 17/01/2018 13:11, Chris Wilson wrote:
> When testing that the timeout fired, we need to be sure we have waited
> just long enough for the timeout to have occurred and for the softirq
> (on another cpu) to have completed. Sleeping for an arbitrary amount is
> prone to error, so wait for the timeout instead and complain if it was
> too late.
> 
> v2: Use wait_event_timeout to provide an upper bound
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 27 +++++---------------------
>   1 file changed, 5 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index 4fb51deb81a1..301f0ce4cd3c 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> @@ -661,7 +661,6 @@ static int test_dma_fence(void *arg)
>   {
>   	struct i915_sw_fence *timeout = NULL, *not = NULL;
>   	unsigned long delay = i915_selftest.timeout_jiffies;
> -	unsigned long end, sleep;
>   	struct dma_fence *dma;
>   	int err;
>   
> @@ -688,36 +687,20 @@ static int test_dma_fence(void *arg)
>   	}
>   
>   	/* We round the timeout for the fence up to the next second */
> -	end = round_jiffies_up(jiffies + delay);
> +	delay = round_jiffies_up_relative(delay);
>   
> -	sleep = jiffies_to_usecs(delay) / 3;
> -	usleep_range(sleep, 2 * sleep);
> -	if (time_after(jiffies, end)) {
> -		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> -		goto skip;
> -	}
> -
> -	if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
> -		pr_err("Fences signaled too early\n");

This check still holds, no? Or there is another test looking at that?

> +	if (wait_event_timeout(timeout->wait,
> +			       i915_sw_fence_done(timeout),
> +			       2 * delay)) {
> +		pr_err("Timeout fence unsignaled!\n");
>   		goto err;

Doh!

Regards,

Tvrtko

>   	}
>   
> -	do {
> -		sleep = jiffies_to_usecs(end - jiffies + 1);
> -		usleep_range(sleep, 2 * sleep);
> -	} while (!time_after(jiffies, end));
> -
>   	if (i915_sw_fence_done(not)) {
>   		pr_err("No timeout fence signaled!\n");
>   		goto err;
>   	}
>   
> -	if (!i915_sw_fence_done(timeout)) {
> -		pr_err("Timeout fence unsignaled!\n");
> -		goto err;
> -	}
> -
> -skip:
>   	dma_fence_signal(dma);
>   
>   	if (!i915_sw_fence_done(timeout) || !i915_sw_fence_done(not)) {
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v2] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 13:36   ` Tvrtko Ursulin
@ 2018-01-17 13:41     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 13:41 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-01-17 13:36:06)
> 
> On 17/01/2018 13:11, Chris Wilson wrote:
> > When testing that the timeout fired, we need to be sure we have waited
> > just long enough for the timeout to have occurred and for the softirq
> > (on another cpu) to have completed. Sleeping for an arbitrary amount is
> > prone to error, so wait for the timeout instead and complain if it was
> > too late.
> > 
> > v2: Use wait_event_timeout to provide an upper bound
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 27 +++++---------------------
> >   1 file changed, 5 insertions(+), 22 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > index 4fb51deb81a1..301f0ce4cd3c 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > @@ -661,7 +661,6 @@ static int test_dma_fence(void *arg)
> >   {
> >       struct i915_sw_fence *timeout = NULL, *not = NULL;
> >       unsigned long delay = i915_selftest.timeout_jiffies;
> > -     unsigned long end, sleep;
> >       struct dma_fence *dma;
> >       int err;
> >   
> > @@ -688,36 +687,20 @@ static int test_dma_fence(void *arg)
> >       }
> >   
> >       /* We round the timeout for the fence up to the next second */
> > -     end = round_jiffies_up(jiffies + delay);
> > +     delay = round_jiffies_up_relative(delay);
> >   
> > -     sleep = jiffies_to_usecs(delay) / 3;
> > -     usleep_range(sleep, 2 * sleep);
> > -     if (time_after(jiffies, end)) {
> > -             pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> > -             goto skip;
> > -     }
> > -
> > -     if (i915_sw_fence_done(timeout) || i915_sw_fence_done(not)) {
> > -             pr_err("Fences signaled too early\n");
> 
> This check still holds, no? Or there is another test looking at that?

We can still use it, I was just a little dubious if it's worth it.
I'll put it back, since it is better than nothing.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev2)
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (3 preceding siblings ...)
  2018-01-17 13:25 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-01-17 13:45 ` Patchwork
  2018-01-17 13:57 ` [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-01-17 13:45 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Wait for the dma-fence timeout (rev2)
URL   : https://patchwork.freedesktop.org/series/36610/
State : success

== Summary ==

Series 36610v2 drm/i915/selftests: Wait for the dma-fence timeout
https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/2/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:421s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:425s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:371s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:493s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:280s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:480s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:471s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:467s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:279s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:516s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:394s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:456s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:418s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:463s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:503s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:577s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:432s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:493s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:485s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:398s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:563s
fi-glk-dsi       total:288  pass:186  dwarn:2   dfail:4   fail:0   skip:96  time:371s

a5cf4f0319302df5036145fd6c96d6966cc677ae drm-tip: 2018y-01m-17d-09h-14m-44s UTC integration manifest
b89c10a43909 drm/i915/selftests: Wait for the dma-fence timeout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7695/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (4 preceding siblings ...)
  2018-01-17 13:45 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev2) Patchwork
@ 2018-01-17 13:57 ` Chris Wilson
  2018-01-17 14:25   ` Tvrtko Ursulin
  2018-01-17 14:02 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev3) Patchwork
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 13:57 UTC (permalink / raw)
  To: intel-gfx

When testing that the timeout fired, we need to be sure we have waited
just long enough for the timeout to have occurred and for the softirq
(on another cpu) to have completed. Sleeping for an arbitrary amount is
prone to error, so wait for the timeout instead and complain if it was
too late.

v2: Use wait_event_timeout to provide an upper bound
v3: Fix inverted check for wait_event_timeout timing out
v4: Restore the check that the fences aren't signalled too early, by
inspecting them before the expected timeout.

References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
index 4fb51deb81a1..570e325af93e 100644
--- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
@@ -693,7 +693,8 @@ static int test_dma_fence(void *arg)
 	sleep = jiffies_to_usecs(delay) / 3;
 	usleep_range(sleep, 2 * sleep);
 	if (time_after(jiffies, end)) {
-		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
+		pr_debug("Slept too long, delay=%lu, (target=%lu, now=%lu) skipping\n",
+			 delay, end, jiffies);
 		goto skip;
 	}
 
@@ -702,18 +703,15 @@ static int test_dma_fence(void *arg)
 		goto err;
 	}
 
-	do {
-		sleep = jiffies_to_usecs(end - jiffies + 1);
-		usleep_range(sleep, 2 * sleep);
-	} while (!time_after(jiffies, end));
-
-	if (i915_sw_fence_done(not)) {
-		pr_err("No timeout fence signaled!\n");
+	if (!wait_event_timeout(timeout->wait,
+				i915_sw_fence_done(timeout),
+				2 * (end - jiffies) + 1)) {
+		pr_err("Timeout fence unsignaled!\n");
 		goto err;
 	}
 
-	if (!i915_sw_fence_done(timeout)) {
-		pr_err("Timeout fence unsignaled!\n");
+	if (i915_sw_fence_done(not)) {
+		pr_err("No timeout fence signaled!\n");
 		goto err;
 	}
 
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev3)
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (5 preceding siblings ...)
  2018-01-17 13:57 ` [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
@ 2018-01-17 14:02 ` Patchwork
  2018-01-17 14:20 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev4) Patchwork
  2018-01-17 16:45 ` ✓ Fi.CI.IGT: " Patchwork
  8 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-01-17 14:02 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Wait for the dma-fence timeout (rev3)
URL   : https://patchwork.freedesktop.org/series/36610/
State : success

== Summary ==

Series 36610v3 drm/i915/selftests: Wait for the dma-fence timeout
https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/3/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:423s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:372s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:480s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:280s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:484s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:483s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:465s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:451s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:278s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:510s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:405s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:411s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:455s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:459s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:500s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:502s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:435s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:513s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:531s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:487s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:486s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:433s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:533s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:393s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:471s
fi-pnv-d510 failed to collect. IGT log at Patchwork_7696/fi-pnv-d510/igt.log

a5cf4f0319302df5036145fd6c96d6966cc677ae drm-tip: 2018y-01m-17d-09h-14m-44s UTC integration manifest
e10f2e1607be drm/i915/selftests: Wait for the dma-fence timeout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7696/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev4)
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (6 preceding siblings ...)
  2018-01-17 14:02 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev3) Patchwork
@ 2018-01-17 14:20 ` Patchwork
  2018-01-17 16:45 ` ✓ Fi.CI.IGT: " Patchwork
  8 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-01-17 14:20 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Wait for the dma-fence timeout (rev4)
URL   : https://patchwork.freedesktop.org/series/36610/
State : success

== Summary ==

Series 36610v4 drm/i915/selftests: Wait for the dma-fence timeout
https://patchwork.freedesktop.org/api/1.0/series/36610/revisions/4/mbox/

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:418s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:372s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:491s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:479s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:464s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:452s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:277s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:514s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:391s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:399s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:412s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:453s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:461s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:503s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:580s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:426s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:505s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:483s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:521s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:394s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:476s

a5cf4f0319302df5036145fd6c96d6966cc677ae drm-tip: 2018y-01m-17d-09h-14m-44s UTC integration manifest
9b9549b28b41 drm/i915/selftests: Wait for the dma-fence timeout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7697/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 13:57 ` [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
@ 2018-01-17 14:25   ` Tvrtko Ursulin
  2018-01-17 17:11     ` Chris Wilson
  0 siblings, 1 reply; 18+ messages in thread
From: Tvrtko Ursulin @ 2018-01-17 14:25 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 17/01/2018 13:57, Chris Wilson wrote:
> When testing that the timeout fired, we need to be sure we have waited
> just long enough for the timeout to have occurred and for the softirq
> (on another cpu) to have completed. Sleeping for an arbitrary amount is
> prone to error, so wait for the timeout instead and complain if it was
> too late.
> 
> v2: Use wait_event_timeout to provide an upper bound
> v3: Fix inverted check for wait_event_timeout timing out
> v4: Restore the check that the fences aren't signalled too early, by
> inspecting them before the expected timeout.
> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 18 ++++++++----------
>   1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> index 4fb51deb81a1..570e325af93e 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> @@ -693,7 +693,8 @@ static int test_dma_fence(void *arg)
>   	sleep = jiffies_to_usecs(delay) / 3;
>   	usleep_range(sleep, 2 * sleep);
>   	if (time_after(jiffies, end)) {
> -		pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> +		pr_debug("Slept too long, delay=%lu, (target=%lu, now=%lu) skipping\n",
> +			 delay, end, jiffies);
>   		goto skip;
>   	}
>   
> @@ -702,18 +703,15 @@ static int test_dma_fence(void *arg)
>   		goto err;
>   	}
>   
> -	do {
> -		sleep = jiffies_to_usecs(end - jiffies + 1);
> -		usleep_range(sleep, 2 * sleep);
> -	} while (!time_after(jiffies, end));
> -
> -	if (i915_sw_fence_done(not)) {
> -		pr_err("No timeout fence signaled!\n");
> +	if (!wait_event_timeout(timeout->wait,
> +				i915_sw_fence_done(timeout),
> +				2 * (end - jiffies) + 1)) {
> +		pr_err("Timeout fence unsignaled!\n");
>   		goto err;
>   	}
>   
> -	if (!i915_sw_fence_done(timeout)) {
> -		pr_err("Timeout fence unsignaled!\n");
> +	if (i915_sw_fence_done(not)) {
> +		pr_err("No timeout fence signaled!\n");
>   		goto err;
>   	}
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.IGT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev4)
  2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
                   ` (7 preceding siblings ...)
  2018-01-17 14:20 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev4) Patchwork
@ 2018-01-17 16:45 ` Patchwork
  8 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2018-01-17 16:45 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/selftests: Wait for the dma-fence timeout (rev4)
URL   : https://patchwork.freedesktop.org/series/36610/
State : success

== Summary ==

Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-render:
                pass       -> INCOMPLETE (shard-hsw) fdo#103167
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                fail       -> PASS       (shard-snb) fdo#101623 +1
Test kms_cursor_legacy:
        Subgroup flip-vs-cursor-legacy:
                pass       -> FAIL       (shard-snb) fdo#102670
Test drv_suspend:
        Subgroup fence-restore-untiled:
                skip       -> PASS       (shard-snb) fdo#102365
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252

fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-hsw        total:2720 pass:1700 dwarn:1   dfail:0   fail:12  skip:1005 time:14527s
shard-snb        total:2753 pass:1318 dwarn:1   dfail:0   fail:11  skip:1423 time:7884s
Blacklisted hosts:
shard-apl        total:2753 pass:1713 dwarn:1   dfail:0   fail:23  skip:1015 time:13824s
shard-kbl        total:2599 pass:1737 dwarn:1   dfail:0   fail:22  skip:839 time:10269s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7697/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout
  2018-01-17 14:25   ` Tvrtko Ursulin
@ 2018-01-17 17:11     ` Chris Wilson
  0 siblings, 0 replies; 18+ messages in thread
From: Chris Wilson @ 2018-01-17 17:11 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-01-17 14:25:17)
> 
> On 17/01/2018 13:57, Chris Wilson wrote:
> > When testing that the timeout fired, we need to be sure we have waited
> > just long enough for the timeout to have occurred and for the softirq
> > (on another cpu) to have completed. Sleeping for an arbitrary amount is
> > prone to error, so wait for the timeout instead and complain if it was
> > too late.
> > 
> > v2: Use wait_event_timeout to provide an upper bound
> > v3: Fix inverted check for wait_event_timeout timing out
> > v4: Restore the check that the fences aren't signalled too early, by
> > inspecting them before the expected timeout.
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=104670
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 18 ++++++++----------
> >   1 file changed, 8 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > index 4fb51deb81a1..570e325af93e 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c
> > @@ -693,7 +693,8 @@ static int test_dma_fence(void *arg)
> >       sleep = jiffies_to_usecs(delay) / 3;
> >       usleep_range(sleep, 2 * sleep);
> >       if (time_after(jiffies, end)) {
> > -             pr_debug("Slept too long, delay=%lu, skipping!\n", delay);
> > +             pr_debug("Slept too long, delay=%lu, (target=%lu, now=%lu) skipping\n",
> > +                      delay, end, jiffies);
> >               goto skip;
> >       }
> >   
> > @@ -702,18 +703,15 @@ static int test_dma_fence(void *arg)
> >               goto err;
> >       }
> >   
> > -     do {
> > -             sleep = jiffies_to_usecs(end - jiffies + 1);
> > -             usleep_range(sleep, 2 * sleep);
> > -     } while (!time_after(jiffies, end));
> > -
> > -     if (i915_sw_fence_done(not)) {
> > -             pr_err("No timeout fence signaled!\n");
> > +     if (!wait_event_timeout(timeout->wait,
> > +                             i915_sw_fence_done(timeout),
> > +                             2 * (end - jiffies) + 1)) {
> > +             pr_err("Timeout fence unsignaled!\n");
> >               goto err;
> >       }
> >   
> > -     if (!i915_sw_fence_done(timeout)) {
> > -             pr_err("Timeout fence unsignaled!\n");
> > +     if (i915_sw_fence_done(not)) {
> > +             pr_err("No timeout fence signaled!\n");
> >               goto err;
> >       }
> >   
> > 
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Ta and pushed,
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-01-17 17:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17 12:15 [PATCH] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
2018-01-17 12:27 ` Tvrtko Ursulin
2018-01-17 12:44   ` Chris Wilson
2018-01-17 12:54     ` Tvrtko Ursulin
2018-01-17 13:11 ` [PATCH v2] " Chris Wilson
2018-01-17 13:36   ` Tvrtko Ursulin
2018-01-17 13:41     ` Chris Wilson
2018-01-17 13:15 ` [PATCH v3] " Chris Wilson
2018-01-17 13:25 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-17 13:29   ` Saarinen, Jani
2018-01-17 13:31     ` Chris Wilson
2018-01-17 13:45 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev2) Patchwork
2018-01-17 13:57 ` [PATCH v4] drm/i915/selftests: Wait for the dma-fence timeout Chris Wilson
2018-01-17 14:25   ` Tvrtko Ursulin
2018-01-17 17:11     ` Chris Wilson
2018-01-17 14:02 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev3) Patchwork
2018-01-17 14:20 ` ✓ Fi.CI.BAT: success for drm/i915/selftests: Wait for the dma-fence timeout (rev4) Patchwork
2018-01-17 16:45 ` ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox