From patchwork Thu Sep 20 08:10:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 1483241 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 25CDDDF2D2 for ; Thu, 20 Sep 2012 08:10:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2BA9FA0BD4 for ; Thu, 20 Sep 2012 01:10:42 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 0CECAA0B92 for ; Thu, 20 Sep 2012 01:10:30 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 20 Sep 2012 01:10:17 -0700 Message-Id: <84c8a8$5q5462@orsmga001.jf.intel.com> X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,453,1344236400"; d="scan'208";a="195203266" Received: from unknown (HELO cantiga.alporthouse.com) ([10.254.110.67]) by orsmga001.jf.intel.com with SMTP; 20 Sep 2012 01:10:27 -0700 Received: by cantiga.alporthouse.com (sSMTP sendmail emulation); Thu, 20 Sep 2012 09:10:06 +0100 From: Chris Wilson To: Daniel Vetter In-Reply-To: <20120920074919.GB2844@bremse> References: <1348064232-6227-1-git-send-email-chris@chris-wilson.co.u> <1348067331-6927-1-git-send-email-chris@chris-wilson.co.uk> <20120920074919.GB2844@bremse> Date: Thu, 20 Sep 2012 09:10:06 +0100 Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH] drm/i915: Wait upon the last request seqno, rather than a future seqno X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org On Thu, 20 Sep 2012 09:49:19 +0200, Daniel Vetter wrote: > On Wed, Sep 19, 2012 at 04:08:51PM +0100, Chris Wilson wrote: > > In commit 69c2fc891343cb5217c866d10709343cff190bdc > > Author: Chris Wilson > > Date: Fri Jul 20 12:41:03 2012 +0100 > > > > drm/i915: Remove the per-ring write list > > > > the explicit flush was removed from i915_ring_idle(). However, we > > continued to wait upon the next seqno which now did not correspond to > > any request (except for the unusual condition of a failure to queue a > > request after execbuffer) and so would wait indefinitely. > > > > Signed-off-by: Chris Wilson > > Afaict gem_next_request_seqno sets ring->olr and i915_wait_seqno does > check whether olr is set and then adds the request - which for ring_idle is > pretty much guaranteed to be missing ;-) Yeah, ok, I'll accept that this is not the root cause of the issue. However, I'm convinced with the merits of the patch for not adding a request to the ring everytime we idle. > So tricky code, but I can't see the bug (and since both module unload and > suspend works, it'd be surprised if there is one). What am I missing here? Obviously you haven't encountered the impossible indefinite wait in __wait_seqno(). It's fairly sporadic, but is an eater of machines... Ah, what about a GPU reset+recovery leaving ring->outstanding_lazy_seqno set but reseting dev_priv->next_seqno to 1. Which is happily fixed up by this patch only looking at existing requests! -Chris diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 39de523..2286e42 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2189,6 +2189,7 @@ static void i915_gem_reset_ring_lists(struct drm_i915_priv i915_gem_request_remove_from_client(request); kfree(request); } + ring->outstanding_lazy_request = 0; while (!list_empty(&ring->active_list)) { struct drm_i915_gem_object *obj;