From: Chris Wilson Subject: Re: [PATCH] drm/i915: forcewake fix after reset Date: Sat, 25 Jun 2011 10:12:13 +0100 Message-ID: References: <1308951107-1987-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 664239E76D for ; Sat, 25 Jun 2011 02:12:29 -0700 (PDT) In-Reply-To: <1308951107-1987-1-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 24 Jun 2011 14:31:47 -0700, Ben Widawsky wrote: > The failure is as follows: > > 1. Userspace gets forcewake lock, lock count >=1 > 2. GPU hang/reset occurs (forcewake bit is reset) > 3. count is now incorrect > > The failure can only occur when using the forcewake userspace lock. > > This has the unfortunate consequence of messing up the driver as well as > userspace, unless userspace closes the debugfs file, the kernel will > never end up waking the GT since the refcount will be > 1. > > The solution is to try to recover the correct forcewake state based on > the refcount. There is a period of time where userspace reads/writes may > occur after the reset, before the GT has been forcewaked. The interface > was never designed to be a perfect solution for userspace reads/writes, > and the kernel portion is fixed by this patch. > > Suggested-by: Chris Wilson > Signed-off-by: Ben Widawsky Excellent change log. My only quibble is that we should do this as gen6_post_reset(), but that can be done when we more tasks to perform after reseting the GPU on different generations. Reviewed-by: Chris Wilson -Chris -- Chris Wilson, Intel Open Source Technology Centre