[PATCH 1/2] drm/i915: time out of load detect busy-waits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 25, 2012 at 06:14:37PM +0100, Chris Wilson wrote:
> On Fri, 20 Apr 2012 21:03:35 +0200, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > If we try to do that and the scanlines just wouldn't advance, we
> > busy-hang the machine holding the modeset mutex. Not great for
> > debugging.
> > 
> > References: https://bugzilla.kernel.org/show_bug.cgi?id=43020
> > Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> 
> Reviewer hangs head in shame:
> 
> > +		if (wait_for(I915_READ(pipe_dsl_reg) >= vactive, 1000))
> > +			DRM_ERROR("timed out waiting for vactive in "
> > +				  "load_detect, scanline: %u\n",
> > +				  I915_READ(pipe_dsl_reg));
> > +		if (wait_for((dsl = I915_READ(pipe_dsl_reg)) <= vsample, 1000))
> > +			DRM_ERROR("timed out waiting for vsample in "
> > +				  "load_detect, scanline: %u\n",
> > +				  I915_READ(pipe_dsl_reg));
> 
> wait_for() catches us out everytime we convert and existing while(),
> because the predicate is when it stops. Perhaps if we had a wait_until,
> but anyway the fix here is:
> 
> if (wait_for(I915_READ(pipe_dsl_reg) < vactive, 1000))
>   ...
> if (wait_for((dsl = I915_READ(pipe_dsl_reg)) > vsample, 1000))
>   ...
dinq rectified, it never happened. Thanks for catching this.

/me hides in the shame corner
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux