From patchwork Mon Aug 6 19:31:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1282421 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 5D1553FC8A for ; Tue, 7 Aug 2012 02:26:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 266699ECC8 for ; Mon, 6 Aug 2012 19:26:24 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id F1D6C9EB2E; Mon, 6 Aug 2012 19:25:11 -0700 (PDT) Received: by shiva.chad-versace.us (Postfix, from userid 1005) id EED4A885AC; Tue, 7 Aug 2012 02:25:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=ALL_TRUSTED, DATE_IN_PAST_06_12 autolearn=no version=3.3.2 Received: from seagal.jf.intel.com (jfdmzpr04-ext.jf.intel.com [134.134.137.73]) by shiva.chad-versace.us (Postfix) with ESMTPSA id 8B129885A2; Tue, 7 Aug 2012 02:24:56 +0000 (UTC) From: Ben Widawsky To: Intel GFX , James Bottomley , dri-devel@lists.freedesktop.org Date: Mon, 6 Aug 2012 12:31:31 -0700 Message-Id: <1344281491-3129-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1343808372.3047.1.camel@dabdike.int.hansenpartnership.com> References: <1343808372.3047.1.camel@dabdike.int.hansenpartnership.com> Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Ben Widawsky , linux-pm@vger.kernel.org Subject: [Intel-gfx] [PATCH] drm/i915: make forcewake work again 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 While trying to track down the power regression, I noticed that on my SNB I had more severe problems, ie. forcewake seemed to never happen once i915 was loaded. After a bit of bisection, I tracked the bad commit to: commit 7b0cfee1a24efdfe0235bac62e53f686fe8a8e24 Merge: 9756fe3 6b16351 Author: Daniel Vetter Date: Mon Jun 25 19:06:12 2012 +0200 Merge tag 'v3.5-rc4' into drm-intel-next-queued I changed the macro to the inline statement to debug a little better and noticed that the problem went away. It's a bit embarrassing, but I can't figure out what is wrong with the old macro. In any case, I think this warrants further review. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index ff569cc..a859169 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1020,10 +1020,13 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL and additional rights"); /* We give fast paths for the really cool registers */ -#define NEEDS_FORCE_WAKE(dev_priv, reg) \ - ((HAS_FORCE_WAKE((dev_priv)->dev)) && \ - ((reg) < 0x40000) && \ - ((reg) != FORCEWAKE)) +static inline bool NEEDS_FORCE_WAKE(struct drm_i915_private *dev_priv, + u32 reg) +{ + return (HAS_FORCE_WAKE(dev_priv->dev)) && + (reg < 0x40000) && + (reg != FORCEWAKE); +} static bool IS_DISPLAYREG(u32 reg) {