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

2015-11-12 Thread Chris Wilson
On Thu, Nov 12, 2015 at 06:40:19PM +0200, Imre Deak wrote:
> 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 
> ---
>  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(_priv->pm.wakelock_count);
> - assert_rpm_wakelock_held(dev_priv);

Otoh, assert_device_not_suspended() still makes sense here.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


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

2015-11-12 Thread Imre Deak
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 
---
 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(_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 = >pdev->dev;
 
+   assert_rpm_wakelock_held(dev_priv);
atomic_dec(_priv->pm.wakelock_count);
 
pm_runtime_mark_last_busy(device);
-- 
2.5.0

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx