diff mbox

drm/i915/psr: Fix warning in intel_psr_activate()

Message ID 20180618220207.2778-1-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan June 18, 2018, 10:02 p.m. UTC
commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
back.") removed the call to cancel a scheduled psr_work from
psr_disable() and instead added an early return in the work function. But,
if the scheduled work item is executed after psr_enable(), we end up
printing warnings as PSR is already enabled and active. So, put the
cancel_work call back in psr_disable().

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_psr.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Rodrigo Vivi June 18, 2018, 10:27 p.m. UTC | #1
On Mon, Jun 18, 2018 at 03:02:07PM -0700, Dhinakaran Pandiyan wrote:
> commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
> back.") removed the call to cancel a scheduled psr_work from
> psr_disable() and instead added an early return in the work function. But,
> if the scheduled work item is executed after psr_enable(), we end up
> printing warnings as PSR is already enabled and active. So, put the
> cancel_work call back in psr_disable().
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

sorry and thanks for fixing it.

> ---
>  drivers/gpu/drm/i915/intel_psr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index ef0f4741a95d..d4cd19fea148 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -754,6 +754,7 @@ void intel_psr_disable(struct intel_dp *intel_dp,
>  
>  	dev_priv->psr.enabled = NULL;
>  	mutex_unlock(&dev_priv->psr.lock);
> +	cancel_work_sync(&dev_priv->psr.work);
>  }
>  
>  static bool psr_wait_for_idle(struct drm_i915_private *dev_priv)
> -- 
> 2.14.1
>
Dhinakaran Pandiyan June 20, 2018, 8:53 p.m. UTC | #2
On Mon, 2018-06-18 at 15:27 -0700, Rodrigo Vivi wrote:
> On Mon, Jun 18, 2018 at 03:02:07PM -0700, Dhinakaran Pandiyan wrote:
> > 
> > commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
> > back.") removed the call to cancel a scheduled psr_work from
> > psr_disable() and instead added an early return in the work
> > function. But,
> > if the scheduled work item is executed after psr_enable(), we end
> > up
> > printing warnings as PSR is already enabled and active. So, put the
> > cancel_work call back in psr_disable().
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: José Roberto de Souza <jose.souza@intel.com>
> > Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
> > back.")
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> 
> sorry and thanks for fixing it.
> 
Not a problem. Thanks for the review, patch pushed to dinq

-DK
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index ef0f4741a95d..d4cd19fea148 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -754,6 +754,7 @@  void intel_psr_disable(struct intel_dp *intel_dp,
 
 	dev_priv->psr.enabled = NULL;
 	mutex_unlock(&dev_priv->psr.lock);
+	cancel_work_sync(&dev_priv->psr.work);
 }
 
 static bool psr_wait_for_idle(struct drm_i915_private *dev_priv)