[Intel-gfx] [PATCH v3 5/7] drm/i915: sanitize the asserts in the RPM get/put helpers

Imre Deak imre.deak at intel.com
Thu Nov 12 08:40:19 PST 2015


There is no point in checking the refcount just after increasing it so
remove the assert from the get helper. Otoh, we should check the
refcount before decreasing it, so add it to the put helper.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 64da5af..db63b8a 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -2132,7 +2132,6 @@ void intel_runtime_pm_get(struct drm_i915_private *dev_priv)
 	pm_runtime_get_sync(device);
 
 	atomic_inc(&dev_priv->pm.wakelock_count);
-	assert_rpm_wakelock_held(dev_priv);
 }
 
 /**
@@ -2176,6 +2175,7 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
 	struct drm_device *dev = dev_priv->dev;
 	struct device *device = &dev->pdev->dev;
 
+	assert_rpm_wakelock_held(dev_priv);
 	atomic_dec(&dev_priv->pm.wakelock_count);
 
 	pm_runtime_mark_last_busy(device);
-- 
2.5.0



More information about the Intel-gfx mailing list