[PATCH] drm/i915/ringbuffer: Fix use of stale HEAD position whilst polling for space

Jiri Slaby jirislaby at gmail.com
Fri Jan 21 00:35:41 PST 2011

On 01/20/2011 06:41 PM, Chris Wilson wrote:
> During suspend, Linus found that his machine would hang for 3 seconds,
> and identified that intel_ring_buffer_wait() was the culprit:

FWIW works for me. From 4s I'm back to:
PM: suspend of devices complete after 1087.670 msecs

BTW I did this change as there are loops running out of bounds of this
array added in 1ec14ad3.
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -52,7 +52,7 @@ struct  intel_ring_buffer {

        u32             irq_seqno;              /* last seq seem at irq
time */
        u32             waiting_seqno;
-       u32             sync_seqno[I915_NUM_RINGS-1];
+       u32             sync_seqno[I915_NUM_RINGS];
        atomic_t        irq_refcount;
        bool __must_check (*irq_get)(struct intel_ring_buffer *ring);
        void            (*irq_put)(struct intel_ring_buffer *ring);


More information about the dri-devel mailing list