diff mbox

[08/11] drm/i915: call assert_device_not_suspended at gen6_force_wake_work

Message ID 1393001548-2883-9-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni Feb. 21, 2014, 4:52 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Because we shouldn't be runtime suspended when forcewake is supposed
to be enabled.

This commit will trigger the WARNs because we currently have a bug
with this. The next patches should fix the bug.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Comments

Paulo Zanoni Feb. 21, 2014, 6:05 p.m. UTC | #1
2014-02-21 13:52 GMT-03:00 Paulo Zanoni <przanoni@gmail.com>:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Because we shouldn't be runtime suspended when forcewake is supposed
> to be enabled.
>
> This commit will trigger the WARNs because we currently have a bug
> with this. The next patches should fix the bug.

Actually I changed the patch order and forgot to remove the sentence
above. Patch 03/11 should fix it.

>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 1f7226f..212de36 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -40,6 +40,12 @@
>
>  #define __raw_posting_read(dev_priv__, reg__) (void)__raw_i915_read32(dev_priv__, reg__)
>
> +static void
> +assert_device_not_suspended(struct drm_i915_private *dev_priv)
> +{
> +       WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
> +            "Device suspended\n");
> +}
>
>  static void __gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
>  {
> @@ -295,6 +301,8 @@ static void gen6_force_wake_work(struct work_struct *work)
>                 container_of(work, typeof(*dev_priv), uncore.force_wake_work.work);
>         unsigned long irqflags;
>
> +       assert_device_not_suspended(dev_priv);
> +
>         spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
>         if (--dev_priv->uncore.forcewake_count == 0)
>                 dev_priv->uncore.funcs.force_wake_put(dev_priv, FORCEWAKE_ALL);
> @@ -451,13 +459,6 @@ hsw_unclaimed_reg_check(struct drm_i915_private *dev_priv, u32 reg)
>         }
>  }
>
> -static void
> -assert_device_not_suspended(struct drm_i915_private *dev_priv)
> -{
> -       WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
> -            "Device suspended\n");
> -}
> -
>  #define REG_READ_HEADER(x) \
>         unsigned long irqflags; \
>         u##x val = 0; \
> --
> 1.8.5.3
>
Imre Deak Feb. 28, 2014, 2:12 p.m. UTC | #2
On Fri, 2014-02-21 at 15:05 -0300, Paulo Zanoni wrote:
> 2014-02-21 13:52 GMT-03:00 Paulo Zanoni <przanoni@gmail.com>:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > Because we shouldn't be runtime suspended when forcewake is supposed
> > to be enabled.
> >
> > This commit will trigger the WARNs because we currently have a bug
> > with this. The next patches should fix the bug.
> 
> Actually I changed the patch order and forgot to remove the sentence
> above. Patch 03/11 should fix it.
> 
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

Patch 3/11 is now part of "Merge PC8 with runtime PM, v2" and this
should come after that. With the order fixed:

Reviewed-by: Imre Deak <imre.deak@intel.com>

> > ---
> >  drivers/gpu/drm/i915/intel_uncore.c | 15 ++++++++-------
> >  1 file changed, 8 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> > index 1f7226f..212de36 100644
> > --- a/drivers/gpu/drm/i915/intel_uncore.c
> > +++ b/drivers/gpu/drm/i915/intel_uncore.c
> > @@ -40,6 +40,12 @@
> >
> >  #define __raw_posting_read(dev_priv__, reg__) (void)__raw_i915_read32(dev_priv__, reg__)
> >
> > +static void
> > +assert_device_not_suspended(struct drm_i915_private *dev_priv)
> > +{
> > +       WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
> > +            "Device suspended\n");
> > +}
> >
> >  static void __gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
> >  {
> > @@ -295,6 +301,8 @@ static void gen6_force_wake_work(struct work_struct *work)
> >                 container_of(work, typeof(*dev_priv), uncore.force_wake_work.work);
> >         unsigned long irqflags;
> >
> > +       assert_device_not_suspended(dev_priv);
> > +
> >         spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
> >         if (--dev_priv->uncore.forcewake_count == 0)
> >                 dev_priv->uncore.funcs.force_wake_put(dev_priv, FORCEWAKE_ALL);
> > @@ -451,13 +459,6 @@ hsw_unclaimed_reg_check(struct drm_i915_private *dev_priv, u32 reg)
> >         }
> >  }
> >
> > -static void
> > -assert_device_not_suspended(struct drm_i915_private *dev_priv)
> > -{
> > -       WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
> > -            "Device suspended\n");
> > -}
> > -
> >  #define REG_READ_HEADER(x) \
> >         unsigned long irqflags; \
> >         u##x val = 0; \
> > --
> > 1.8.5.3
> >
> 
> 
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 1f7226f..212de36 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -40,6 +40,12 @@ 
 
 #define __raw_posting_read(dev_priv__, reg__) (void)__raw_i915_read32(dev_priv__, reg__)
 
+static void
+assert_device_not_suspended(struct drm_i915_private *dev_priv)
+{
+	WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
+	     "Device suspended\n");
+}
 
 static void __gen6_gt_wait_for_thread_c0(struct drm_i915_private *dev_priv)
 {
@@ -295,6 +301,8 @@  static void gen6_force_wake_work(struct work_struct *work)
 		container_of(work, typeof(*dev_priv), uncore.force_wake_work.work);
 	unsigned long irqflags;
 
+	assert_device_not_suspended(dev_priv);
+
 	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
 	if (--dev_priv->uncore.forcewake_count == 0)
 		dev_priv->uncore.funcs.force_wake_put(dev_priv, FORCEWAKE_ALL);
@@ -451,13 +459,6 @@  hsw_unclaimed_reg_check(struct drm_i915_private *dev_priv, u32 reg)
 	}
 }
 
-static void
-assert_device_not_suspended(struct drm_i915_private *dev_priv)
-{
-	WARN(HAS_RUNTIME_PM(dev_priv->dev) && dev_priv->pm.suspended,
-	     "Device suspended\n");
-}
-
 #define REG_READ_HEADER(x) \
 	unsigned long irqflags; \
 	u##x val = 0; \