intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails
@ 2016-01-13 12:52 John.C.Harrison
  2016-01-13 13:09 ` Chris Wilson
  2016-01-13 13:49 ` ✗ failure: Fi.CI.BAT Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: John.C.Harrison @ 2016-01-13 12:52 UTC (permalink / raw)
  To: Intel-GFX

From: John Harrison <John.C.Harrison@Intel.com>

The reserved space code was not cleaning up properly in the case where
the intel_ring_begin() call failed. This led to WARN_ONs firing about
a double reserve call when running the gem_reset_stats IGT test.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c        | 8 +++++++-
 drivers/gpu/drm/i915/intel_ringbuffer.c | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 06180dc..7dcc299 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -835,6 +835,8 @@ int intel_logical_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
 
 int intel_logical_ring_reserve_space(struct drm_i915_gem_request *request)
 {
+	int ret;
+
 	/*
 	 * The first call merely notes the reserve request and is common for
 	 * all back ends. The subsequent localised _begin() call actually
@@ -845,7 +847,11 @@ int intel_logical_ring_reserve_space(struct drm_i915_gem_request *request)
 	 */
 	intel_ring_reserved_space_reserve(request->ringbuf, MIN_SPACE_FOR_ADD_REQUEST);
 
-	return intel_logical_ring_begin(request, 0);
+	ret = intel_logical_ring_begin(request, 0);
+	if (ret)
+		intel_ring_reserved_space_cancel(request->ringbuf);
+
+	return ret;
 }
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index c9b081f..f1d3a4a 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2296,6 +2296,8 @@ int intel_ring_alloc_request_extras(struct drm_i915_gem_request *request)
 
 int intel_ring_reserve_space(struct drm_i915_gem_request *request)
 {
+	int ret;
+
 	/*
 	 * The first call merely notes the reserve request and is common for
 	 * all back ends. The subsequent localised _begin() call actually
@@ -2306,7 +2308,11 @@ int intel_ring_reserve_space(struct drm_i915_gem_request *request)
 	 */
 	intel_ring_reserved_space_reserve(request->ringbuf, MIN_SPACE_FOR_ADD_REQUEST);
 
-	return intel_ring_begin(request, 0);
+	ret = intel_ring_begin(request, 0);
+	if (ret)
+		intel_ring_reserved_space_cancel(request->ringbuf);
+
+	return ret;
 }
 
 void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf, int size)
-- 
1.9.1

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

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

* Re: [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails
  2016-01-13 12:52 [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails John.C.Harrison
@ 2016-01-13 13:09 ` Chris Wilson
  2016-01-13 13:48   ` John Harrison
  2016-01-13 13:49 ` ✗ failure: Fi.CI.BAT Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-01-13 13:09 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: Intel-GFX

On Wed, Jan 13, 2016 at 12:52:40PM +0000, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
> 
> The reserved space code was not cleaning up properly in the case where
> the intel_ring_begin() call failed. This led to WARN_ONs firing about
> a double reserve call when running the gem_reset_stats IGT test.

*reserve_space() failure leads to a i915_gem_request_cancel() which
calls intel_ring_reserved_space_cancel().
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails
  2016-01-13 13:09 ` Chris Wilson
@ 2016-01-13 13:48   ` John Harrison
  0 siblings, 0 replies; 4+ messages in thread
From: John Harrison @ 2016-01-13 13:48 UTC (permalink / raw)
  To: Chris Wilson, Intel-GFX

On 13/01/2016 13:09, Chris Wilson wrote:
> On Wed, Jan 13, 2016 at 12:52:40PM +0000, John.C.Harrison@Intel.com wrote:
>> From: John Harrison <John.C.Harrison@Intel.com>
>>
>> The reserved space code was not cleaning up properly in the case where
>> the intel_ring_begin() call failed. This led to WARN_ONs firing about
>> a double reserve call when running the gem_reset_stats IGT test.
> *reserve_space() failure leads to a i915_gem_request_cancel() which
> calls intel_ring_reserved_space_cancel().
> -Chris
>

Hmm, this is very true. Evidently something weird is going on in my 
tree. Ignore this patch!

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

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

* ✗ failure: Fi.CI.BAT
  2016-01-13 12:52 [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails John.C.Harrison
  2016-01-13 13:09 ` Chris Wilson
@ 2016-01-13 13:49 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-01-13 13:49 UTC (permalink / raw)
  To: John.C.Harrison; +Cc: intel-gfx

== Summary ==

Built on 4d09810b01441f9124c072a866f608b748f92f6c drm-intel-nightly: 2016y-01m-13d-12h-32m-08s UTC integration manifest

Test gem_basic:
        Subgroup create-close:
                pass       -> DMESG-WARN (skl-i5k-2)
Test gem_cpu_reloc:
        Subgroup basic:
                pass       -> DMESG-FAIL (skl-i5k-2)
Test gem_ctx_param_basic:
        Subgroup basic:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup invalid-param-set:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup non-root-set-no-zeromap:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup root-set-no-zeromap-disabled:
                pass       -> DMESG-WARN (skl-i5k-2)
Test gem_mmap:
        Subgroup basic:
                pass       -> DMESG-WARN (skl-i5k-2)
Test gem_mmap_gtt:
        Subgroup basic-read:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup basic-write:
                pass       -> DMESG-WARN (skl-i5k-2)
Test gem_storedw_loop:
        Subgroup basic-render:
                pass       -> DMESG-WARN (skl-i5k-2) UNSTABLE
                pass       -> DMESG-WARN (bdw-nuci7)
                pass       -> DMESG-WARN (bdw-ultra)
Test kms_addfb_basic:
        Subgroup addfb25-modifier-no-flag:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup addfb25-x-tiled-mismatch:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup addfb25-yf-tiled:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup bad-pitch-1024:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup bad-pitch-63:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup bad-pitch-999:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup clobberred-modifier:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup too-high:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup too-wide:
                pass       -> DMESG-WARN (skl-i5k-2)
        Subgroup unused-offsets:
                pass       -> DMESG-WARN (skl-i5k-2)
Test kms_flip:
        Subgroup basic-plain-flip:
                pass       -> DMESG-FAIL (skl-i5k-2)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> DMESG-FAIL (skl-i5k-2)
        Subgroup read-crc-pipe-b:
                pass       -> DMESG-WARN (ilk-hp8440p)
        Subgroup read-crc-pipe-b-frame-sequence:
                pass       -> DMESG-FAIL (skl-i5k-2)
Test prime_self_import:
        Subgroup basic-with_two_bos:
                pass       -> DMESG-WARN (skl-i5k-2)

bdw-nuci7        total:138  pass:128  dwarn:1   dfail:0   fail:0   skip:9  
bdw-ultra        total:138  pass:131  dwarn:1   dfail:0   fail:0   skip:6  
bsw-nuc-2        total:141  pass:115  dwarn:2   dfail:0   fail:0   skip:24 
hsw-brixbox      total:141  pass:134  dwarn:0   dfail:0   fail:0   skip:7  
hsw-gt2          total:141  pass:137  dwarn:0   dfail:0   fail:0   skip:4  
ilk-hp8440p      total:141  pass:99   dwarn:5   dfail:0   fail:0   skip:37 
ivb-t430s        total:135  pass:122  dwarn:3   dfail:4   fail:0   skip:6  
skl-i5k-2        total:141  pass:107  dwarn:21  dfail:4   fail:0   skip:8  
skl-i7k-2        total:141  pass:131  dwarn:2   dfail:0   fail:0   skip:8  
snb-dellxps      total:141  pass:122  dwarn:5   dfail:0   fail:0   skip:14 
snb-x220t        total:141  pass:122  dwarn:5   dfail:0   fail:1   skip:13 

Results at /archive/results/CI_IGT_test/Patchwork_1165/

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

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

end of thread, other threads:[~2016-01-13 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-13 12:52 [PATCH] drm/i915: Fix for reserved space WARN_ON when ring begin fails John.C.Harrison
2016-01-13 13:09 ` Chris Wilson
2016-01-13 13:48   ` John Harrison
2016-01-13 13:49 ` ✗ failure: Fi.CI.BAT Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).