diff mbox

[1/6] drm/i915: don't schedule force_wake_timer at gen6_read

Message ID 1394233524-3522-2-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni March 7, 2014, 11:05 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

So far force_wake_timer was only used by gen6_gt_force_wake_put. Since
we always had balanced gen6_gt_force_wake_get/put calls, we could
guarantee balanced calls to intel_runtime_pm_get/put.

Commit 8232644ccf099548710843e97360a3fcd6d28e04, "drm/i915: Convert
the forcewake worker into a timer func" started scheduling the
force_wake_timer at gen6_read, which resulted in an unbalanced
runtime_pm refcount.

So this commit just reverts to the old behavior until we can find a
proper way to used delayed force_wake from the register read/write
macros without leaving the runtime_pm refcounts unbalanced and without
runtime suspending the driver while forcewake is active.

Testcase: igt/pm_pc8
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Chris Wilson March 8, 2014, 9:36 a.m. UTC | #1
On Fri, Mar 07, 2014 at 08:05:19PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> 
> So far force_wake_timer was only used by gen6_gt_force_wake_put. Since
> we always had balanced gen6_gt_force_wake_get/put calls, we could
> guarantee balanced calls to intel_runtime_pm_get/put.

I'm sure you can think of a trivial way to put things back into balance.
-Chris
Daniel Vetter March 8, 2014, 10:27 a.m. UTC | #2
On Sat, Mar 08, 2014 at 09:36:01AM +0000, Chris Wilson wrote:
> On Fri, Mar 07, 2014 at 08:05:19PM -0300, Paulo Zanoni wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > 
> > So far force_wake_timer was only used by gen6_gt_force_wake_put. Since
> > we always had balanced gen6_gt_force_wake_get/put calls, we could
> > guarantee balanced calls to intel_runtime_pm_get/put.
> 
> I'm sure you can think of a trivial way to put things back into balance.

Yeah, I think a __force_wake_timer which doesn't do the runtime put should
be good enough. Chris, can I sign you up for this since Paulo is now on
vacation for 2 weeks? No real hurry since we need to stall for QA to hit
this anyway - if they still fail to properly run the runtime pm tests then
I need to go into full maintainer beserk mode ;-)

Cheers, Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 7861d97..c91c0c2 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -504,11 +504,12 @@  gen6_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \
 	    NEEDS_FORCE_WAKE((dev_priv), (reg))) { \
 		dev_priv->uncore.funcs.force_wake_get(dev_priv, \
 						      FORCEWAKE_ALL); \
-		dev_priv->uncore.forcewake_count++; \
-		mod_timer_pinned(&dev_priv->uncore.force_wake_timer, \
-				 jiffies + 1); \
+		val = __raw_i915_read##x(dev_priv, reg); \
+		dev_priv->uncore.funcs.force_wake_put(dev_priv, \
+						      FORCEWAKE_ALL); \
+	} else { \
+		val = __raw_i915_read##x(dev_priv, reg); \
 	} \
-	val = __raw_i915_read##x(dev_priv, reg); \
 	REG_READ_FOOTER; \
 }