From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/i915: time out of load detect busy-waits Date: Wed, 25 Apr 2012 21:26:50 +0200 Message-ID: <20120425192650.GG5079@phenom.ffwll.local> References: <1334948616-16073-1-git-send-email-daniel.vetter@ffwll.ch> <1335374112_49610@CP5-2952> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id F1F7A9F75B for ; Wed, 25 Apr 2012 12:25:51 -0700 (PDT) Received: by mail-we0-f177.google.com with SMTP id p11so360846wer.36 for ; Wed, 25 Apr 2012 12:25:51 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1335374112_49610@CP5-2952> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Wed, Apr 25, 2012 at 06:14:37PM +0100, Chris Wilson wrote: > On Fri, 20 Apr 2012 21:03:35 +0200, Daniel Vetter 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 > > 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@ffwll.ch Mobile: +41 (0)79 365 57 48