[Intel-gfx] [PATCH] drm/i915: Fix pipe off timeout handling for pre-gen4

Daniel Vetter daniel at ffwll.ch
Thu Oct 10 23:11:39 CEST 2013

On Thu, Oct 10, 2013 at 09:42:44PM +0100, Chris Wilson wrote:
> On Thu, Oct 10, 2013 at 08:32:23PM +0300, ville.syrjala at linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > The current pre-gen4 pipe off code might break out of the loop
> > due to the timeout, but then the fail to print the warning.
> > 
> > Fix the issue by making sure we pair up the correct time comparison
> > functions. It would be enough to change just the final check to use
> > time_after_eq(), but also changing the loop condition to use
> > time_before() instead of time_after() makes the whole thing look a
> > bit saner since then we always compare jiffies and timeout in the same
> > order, and the words before and after now feel more natural when
> > talking about the timeout.
> Don't you also want to recheck last_line just in case it managed to
> finish in the nick of time?

Indeed, this is the same bug as with all those waits - we need to recheck
the condition after the wait in case the scheduler was a bully and didn't
give us any cpu time before the timeout elapsed.

I'll drop the patch again and hide in shame ;-)
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

More information about the Intel-gfx mailing list