public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/i915: Fix unnoticed failure of init_ring_common()
@ 2014-06-18 22:38 Konrad Zapalowicz
  2014-06-19  6:15 ` Daniel Vetter
  2014-06-19 17:07 ` [PATCH v2] " Konrad Zapalowicz
  0 siblings, 2 replies; 8+ messages in thread
From: Konrad Zapalowicz @ 2014-06-18 22:38 UTC (permalink / raw)
  To: daniel.vetter
  Cc: jani.nikula, airlied, intel-gfx, dri-devel, linux-kernel,
	Konrad Zapalowicz

This commit add check for return value of init_ring_common() in the
init_render_ring(). Now, when failure is detected the error code is
propagated to the caller layer instead of being ignored.

I believe that this fix will have a positive impact on the oops that
I hit recently and which starts when init_ring_common() fails:

    [drm:init_ring_common] *ERROR* render ring initialization failed
             ctl 0001f001 head 0000000c tail 00000000 start 003eb000
    BUG: unable to handle kernel NULL pointer dereference at 0000006c
    IP: [<f8ca1679>] i915_gem_obj_to_ggtt+0x9/0x40 [i915]

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 279488a..d205b0d 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -604,6 +604,8 @@ static int init_render_ring(struct intel_engine_cs *ring)
 	struct drm_device *dev = ring->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int ret = init_ring_common(ring);
+	if (ret)
+		return ret;
 
 	/* WaTimedSingleVertexDispatch:cl,bw,ctg,elk,ilk,snb */
 	if (INTEL_INFO(dev)->gen >= 4 && INTEL_INFO(dev)->gen < 7)
-- 
1.8.1.2


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

end of thread, other threads:[~2014-06-19 19:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 22:38 [PATCH] drivers/i915: Fix unnoticed failure of init_ring_common() Konrad Zapalowicz
2014-06-19  6:15 ` Daniel Vetter
2014-06-19 12:45   ` Konrad Zapalowicz
2014-06-19 14:35     ` Daniel Vetter
2014-06-19 14:36       ` Daniel Vetter
2014-06-19 14:42         ` Konrad Zapalowicz
2014-06-19 17:07 ` [PATCH v2] " Konrad Zapalowicz
2014-06-19 19:00   ` Daniel Vetter

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