From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH 1/5] drm/i915: Fix forcewake counts for gen8 Date: Mon, 24 Feb 2014 13:27:09 +0200 Message-ID: <20140224112709.GL3852@intel.com> References: <1392996723-8886-1-git-send-email-mika.kuoppala@intel.com> <1392996723-8886-2-git-send-email-mika.kuoppala@intel.com> <20140221193847.GA7594@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AE7BFA9D3 for ; Mon, 24 Feb 2014 03:27:15 -0800 (PST) Content-Disposition: inline In-Reply-To: <20140221193847.GA7594@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Ben Widawsky Cc: Ben Widawsky , intel-gfx@lists.freedesktop.org, miku@iki.fi, mika.kuoppala@intel.com List-Id: intel-gfx@lists.freedesktop.org On Fri, Feb 21, 2014 at 11:38:48AM -0800, Ben Widawsky wrote: > On Fri, Feb 21, 2014 at 05:31:59PM +0200, mika.kuoppala@intel.com wrote: > > From: Mika Kuoppala > > = > > Sometimes generic driver code gets forcewake explicitly by > > gen6_gt_force_wake_get(), which check forcewake_count before accessing > > hardware. However the register access with gen8_write function access > > low level hw accessors directly, ignoring the forcewake_count. This > > leads to nested forcewake get from hardware, in ring init and possibly > > elsewhere, causing forcewake ack clear errors and/or hangs. > > = > > Fix this by checking the forcewake count also in gen8_write > > = > > v2: Read side doesn't care about shadowed registers, > > Remove __needs_put funkiness from gen8_write. (Ville) > > Improved commit message. > > = > > References: https://bugs.freedesktop.org/show_bug.cgi?id=3D74007 > > Cc: Ben Widawsky > > Cc: Ville Syrj=E4l=E4 > > Signed-off-by: Mika Kuoppala > > Reviewed-by: Ben Widawsky > = > For those concerned with the performance implication of the extra if > (if anyone at all cares, it's Chris) - I suppose we could also just add > the lock to gen6_gt_force_wake_get/put. Two things: a) I don't understand what you mean here. uncore.lock already protects the forcewake count in gen6_gt_force_wake_get/put. Also there's no way to avoid the branch here since doing a .force_wake_put() w/o checking the forcewake count is never ok. b) The cost of branch should be a drop in the ocean compared to the cost of the register reads/writes in .forcewake_get/put. -- = Ville Syrj=E4l=E4 Intel OTC