All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: restore the early forcewake cleanup
@ 2013-11-16 15:00 Daniel Vetter
  2013-11-16 18:52 ` Jörg Otte
  2013-11-17 10:53 ` Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-16 15:00 UTC (permalink / raw)
  To: Intel Graphics Development
  Cc: Daniel Vetter, Mika Kuoppala, Chris Wilson, Jörg Otte,
	for 3.12 only

Some BIOS just leak the forcewak bits, which we clean up.
Unfortunately this has been broken in

commit 521198a2e7095c8c7daa8d7d3a76a110c346be6f
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Date:   Fri Aug 23 16:52:30 2013 +0300

    drm/i915: sanitize forcewake registers on reset

To make this work both for resets and for BIOS takeover just add the
forcewake clearing call back to intel_uncore_early_sanitize.

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reported-by: Jörg Otte <jrg.otte@gmail.com>
Cc: Jörg Otte <jrg.otte@gmail.com>
References: https://lkml.org/lkml/2013/11/16/40
Cc: stable@vger.kernel.org (for 3.12 only)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_uncore.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 29532aeef294..ed65f5f93a59 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -217,6 +217,19 @@ static void gen6_force_wake_work(struct work_struct *work)
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
+static void intel_uncore_forcewake_reset(struct drm_device *dev)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	if (IS_VALLEYVIEW(dev)) {
+		vlv_force_wake_reset(dev_priv);
+	} else if (INTEL_INFO(dev)->gen >= 6) {
+		__gen6_gt_force_wake_reset(dev_priv);
+		if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
+			__gen6_gt_force_wake_mt_reset(dev_priv);
+	}
+}
+
 void intel_uncore_early_sanitize(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -234,19 +247,8 @@ void intel_uncore_early_sanitize(struct drm_device *dev)
 		dev_priv->ellc_size = 128;
 		DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size);
 	}
-}
 
-static void intel_uncore_forcewake_reset(struct drm_device *dev)
-{
-	struct drm_i915_private *dev_priv = dev->dev_private;
-
-	if (IS_VALLEYVIEW(dev)) {
-		vlv_force_wake_reset(dev_priv);
-	} else if (INTEL_INFO(dev)->gen >= 6) {
-		__gen6_gt_force_wake_reset(dev_priv);
-		if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
-			__gen6_gt_force_wake_mt_reset(dev_priv);
-	}
+	intel_uncore_forcewake_reset(dev);
 }
 
 void intel_uncore_sanitize(struct drm_device *dev)
-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: restore the early forcewake cleanup
  2013-11-16 15:00 [PATCH] drm/i915: restore the early forcewake cleanup Daniel Vetter
@ 2013-11-16 18:52 ` Jörg Otte
  2013-11-17 10:53 ` Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: Jörg Otte @ 2013-11-16 18:52 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, for 3.12 only

2013/11/16 Daniel Vetter <daniel.vetter@ffwll.ch>:
> Some BIOS just leak the forcewak bits, which we clean up.
> Unfortunately this has been broken in
>
> commit 521198a2e7095c8c7daa8d7d3a76a110c346be6f
> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Date:   Fri Aug 23 16:52:30 2013 +0300
>
>     drm/i915: sanitize forcewake registers on reset
>
> To make this work both for resets and for BIOS takeover just add the
> forcewake clearing call back to intel_uncore_early_sanitize.
>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reported-by: Jörg Otte <jrg.otte@gmail.com>
> Cc: Jörg Otte <jrg.otte@gmail.com>
> References: https://lkml.org/lkml/2013/11/16/40
> Cc: stable@vger.kernel.org (for 3.12 only)
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 29532aeef294..ed65f5f93a59 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -217,6 +217,19 @@ static void gen6_force_wake_work(struct work_struct *work)
>         spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
>  }
>
> +static void intel_uncore_forcewake_reset(struct drm_device *dev)
> +{
> +       struct drm_i915_private *dev_priv = dev->dev_private;
> +
> +       if (IS_VALLEYVIEW(dev)) {
> +               vlv_force_wake_reset(dev_priv);
> +       } else if (INTEL_INFO(dev)->gen >= 6) {
> +               __gen6_gt_force_wake_reset(dev_priv);
> +               if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
> +                       __gen6_gt_force_wake_mt_reset(dev_priv);
> +       }
> +}
> +
>  void intel_uncore_early_sanitize(struct drm_device *dev)
>  {
>         struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -234,19 +247,8 @@ void intel_uncore_early_sanitize(struct drm_device *dev)
>                 dev_priv->ellc_size = 128;
>                 DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size);
>         }
> -}
>
> -static void intel_uncore_forcewake_reset(struct drm_device *dev)
> -{
> -       struct drm_i915_private *dev_priv = dev->dev_private;
> -
> -       if (IS_VALLEYVIEW(dev)) {
> -               vlv_force_wake_reset(dev_priv);
> -       } else if (INTEL_INFO(dev)->gen >= 6) {
> -               __gen6_gt_force_wake_reset(dev_priv);
> -               if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev))
> -                       __gen6_gt_force_wake_mt_reset(dev_priv);
> -       }
> +       intel_uncore_forcewake_reset(dev);
>  }
>
>  void intel_uncore_sanitize(struct drm_device *dev)
> --
> 1.8.4.3
>


Patch works for me, Thanks again!
Jörg
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: restore the early forcewake cleanup
  2013-11-16 15:00 [PATCH] drm/i915: restore the early forcewake cleanup Daniel Vetter
  2013-11-16 18:52 ` Jörg Otte
@ 2013-11-17 10:53 ` Chris Wilson
  2013-11-17 11:12   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2013-11-17 10:53 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development, for 3.12 only, Jörg Otte

On Sat, Nov 16, 2013 at 04:00:09PM +0100, Daniel Vetter wrote:
> Some BIOS just leak the forcewak bits, which we clean up.
> Unfortunately this has been broken in
> 
> commit 521198a2e7095c8c7daa8d7d3a76a110c346be6f
> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Date:   Fri Aug 23 16:52:30 2013 +0300
> 
>     drm/i915: sanitize forcewake registers on reset
> 
> To make this work both for resets and for BIOS takeover just add the
> forcewake clearing call back to intel_uncore_early_sanitize.

The call to intel_uncore_forcewake_reset() is in
intel_uncore_sanitize(). Do you mind explaining the dependence that
causes us to require an ealry_sanitize?  There's no issue in doing so,
just the change log feels inaccurate.
 
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reported-by: Jörg Otte <jrg.otte@gmail.com>
> Cc: Jörg Otte <jrg.otte@gmail.com>
> References: https://lkml.org/lkml/2013/11/16/40
> Cc: stable@vger.kernel.org (for 3.12 only)
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: restore the early forcewake cleanup
  2013-11-17 10:53 ` Chris Wilson
@ 2013-11-17 11:12   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2013-11-17 11:12 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, Intel Graphics Development,
	Mika Kuoppala, Jörg Otte, for 3.12 only

On Sun, Nov 17, 2013 at 11:53 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Sat, Nov 16, 2013 at 04:00:09PM +0100, Daniel Vetter wrote:
>> Some BIOS just leak the forcewak bits, which we clean up.
>> Unfortunately this has been broken in
>>
>> commit 521198a2e7095c8c7daa8d7d3a76a110c346be6f
>> Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> Date:   Fri Aug 23 16:52:30 2013 +0300
>>
>>     drm/i915: sanitize forcewake registers on reset
>>
>> To make this work both for resets and for BIOS takeover just add the
>> forcewake clearing call back to intel_uncore_early_sanitize.
>
> The call to intel_uncore_forcewake_reset() is in
> intel_uncore_sanitize(). Do you mind explaining the dependence that
> causes us to require an ealry_sanitize?  There's no issue in doing so,
> just the change log feels inaccurate.

Yeah I've forgotten to write down my analysis:

"We need to clear the forcewake in early sanitize so that the forcewak
dance in intel_uncore_init (to figure out whether we have mt or legacy
forcewake on ivb) works. That cleanup fits in nicely with the general
topic of early_sanitize to prepare for the very first mmio ops."

I'll add this to the commit message.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-17 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-16 15:00 [PATCH] drm/i915: restore the early forcewake cleanup Daniel Vetter
2013-11-16 18:52 ` Jörg Otte
2013-11-17 10:53 ` Chris Wilson
2013-11-17 11:12   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.