diff mbox

drm/i915: Hold irq uncore.lock when initialising fw_domains

Message ID 1467566973-13596-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 3, 2016, 5:29 p.m. UTC
Acquiring the forcewake domain asserts that it is in an atomic section
(as we always expect to under the uncore.lock). This true expect for
initialising the domains on Ivybridge, and so we generate a warning.
Wrap the manual usage of fw_domains inside the spin_lock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tvrtko Ursulin July 4, 2016, 9:06 a.m. UTC | #1
On 03/07/16 18:29, Chris Wilson wrote:
> Acquiring the forcewake domain asserts that it is in an atomic section
> (as we always expect to under the uncore.lock). This true expect for
> initialising the domains on Ivybridge, and so we generate a warning.
> Wrap the manual usage of fw_domains inside the spin_lock.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_uncore.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 7da3906badf3..1d65209c0998 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1299,9 +1299,11 @@ static void intel_uncore_fw_domains_init(struct drm_i915_private *dev_priv)
>   		fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
>   			       FORCEWAKE_MT, FORCEWAKE_MT_ACK);
>
> +		spin_lock_irq(&dev_priv->uncore.lock);
>   		fw_domains_get_with_thread_status(dev_priv, FORCEWAKE_ALL);
>   		ecobus = __raw_i915_read32(dev_priv, ECOBUS);
>   		fw_domains_put_with_fifo(dev_priv, FORCEWAKE_ALL);
> +		spin_unlock_irq(&dev_priv->uncore.lock);
>
>   		if (!(ecobus & FORCEWAKE_MT_ENABLE)) {
>   			DRM_INFO("No MT forcewake available on Ivybridge, this can result in issues\n");
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Chris Wilson July 4, 2016, 9:29 a.m. UTC | #2
On Mon, Jul 04, 2016 at 10:06:14AM +0100, Tvrtko Ursulin wrote:
> 
> On 03/07/16 18:29, Chris Wilson wrote:
> >Acquiring the forcewake domain asserts that it is in an atomic section
> >(as we always expect to under the uncore.lock). This true expect for
> >initialising the domains on Ivybridge, and so we generate a warning.
> >Wrap the manual usage of fw_domains inside the spin_lock.
> >
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >Cc: Mika Kuoppala <mika.kuoppala@intel.com>

> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Thanks, gave the changelog a once-over for grammar and pushed.
-Chris
Mika Kuoppala July 4, 2016, 9:37 a.m. UTC | #3
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Acquiring the forcewake domain asserts that it is in an atomic section
> (as we always expect to under the uncore.lock). This true expect for
> initialising the domains on Ivybridge, and so we generate a warning.
> Wrap the manual usage of fw_domains inside the spin_lock.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 7da3906badf3..1d65209c0998 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1299,9 +1299,11 @@ static void intel_uncore_fw_domains_init(struct drm_i915_private *dev_priv)
>  		fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
>  			       FORCEWAKE_MT, FORCEWAKE_MT_ACK);
>  
> +		spin_lock_irq(&dev_priv->uncore.lock);
>  		fw_domains_get_with_thread_status(dev_priv, FORCEWAKE_ALL);
>  		ecobus = __raw_i915_read32(dev_priv, ECOBUS);
>  		fw_domains_put_with_fifo(dev_priv, FORCEWAKE_ALL);
> +		spin_unlock_irq(&dev_priv->uncore.lock);
>  
>  		if (!(ecobus & FORCEWAKE_MT_ENABLE)) {
>  			DRM_INFO("No MT forcewake available on Ivybridge, this can result in issues\n");
> -- 
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 7da3906badf3..1d65209c0998 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1299,9 +1299,11 @@  static void intel_uncore_fw_domains_init(struct drm_i915_private *dev_priv)
 		fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
 			       FORCEWAKE_MT, FORCEWAKE_MT_ACK);
 
+		spin_lock_irq(&dev_priv->uncore.lock);
 		fw_domains_get_with_thread_status(dev_priv, FORCEWAKE_ALL);
 		ecobus = __raw_i915_read32(dev_priv, ECOBUS);
 		fw_domains_put_with_fifo(dev_priv, FORCEWAKE_ALL);
+		spin_unlock_irq(&dev_priv->uncore.lock);
 
 		if (!(ecobus & FORCEWAKE_MT_ENABLE)) {
 			DRM_INFO("No MT forcewake available on Ivybridge, this can result in issues\n");