Skip to contentSkip to conversation

drm/i915: Bring UP Power Wells before disabling RC6.

PATCH Superseded [email protected] 2 participants 5 messages Dec 8, 2013 – Dec 10, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 drm/i915: Bring UP Power Wells before disabling RC6.

From: Deepak S <[email protected]>

Instead of waiting for HW to bringup the wells, We force the wells up before disabling RC6. This is to avoid any register access when wells are down.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +6 -0
index 2e1340f..089712a 100644
@@ -3661,6 +3661,12 @@ static void gen6_disable_rps(struct drm_device *dev)
 static void valleyview_disable_rps(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long irqflags;
+
+	/* We need to bring up the wells before disabling the RC6 */
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+	dev_priv->uncore.funcs.force_wake_get(dev_priv, FORCEWAKE_ALL);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 
 	I915_WRITE(GEN6_RC_CONTROL, 0);
 
Signature · 1 line
1.8.4.2
#1 lore raw
Quoted 16 lines · On Sun, Dec 08, 2013 at 01:52:46PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Instead of waiting for HW to bringup the wells, We force the wells up before disabling RC6. This is to avoid any register access when wells are down.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 2e1340f..089712a 100644

drivers/gpu/drm/i915/intel_pm.c static void gen6_disable_rps(struct drm_device *dev) · line 3669

Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
@@ -3661,6 +3661,12 @@ static void gen6_disable_rps(struct drm_device *dev)
 static void valleyview_disable_rps(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long irqflags;
+
+	/* We need to bring up the wells before disabling the RC6 */
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+	dev_priv->uncore.funcs.force_wake_get(dev_priv, FORCEWAKE_ALL);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend? -Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	I915_WRITE(GEN6_RC_CONTROL, 0);
 
Signature · 6 lines
1.8.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
author
#2 lore raw
Quoted 1 line

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend?

Yes Daniel, this was sequence recommended when going into suspend/Resume path.

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, December 9, 2013 1:31 PM
To: S, Deepak
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Bring UP Power Wells before disabling RC6.

Quoted 16 lines · On Sun, Dec 08, 2013 at 01:52:46PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Instead of waiting for HW to bringup the wells, We force the wells up before disabling RC6. This is to avoid any register access when wells are down.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_pm.c index 2e1340f..089712a 100644

drivers/gpu/drm/i915/intel_pm.c static void gen6_disable_rps(struct drm_device · line 3668

Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
@@ -3661,6 +3661,12 @@ static void gen6_disable_rps(struct drm_device 
 *dev)  static void valleyview_disable_rps(struct drm_device *dev)  {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long irqflags;
+
+	/* We need to bring up the wells before disabling the RC6 */
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+	dev_priv->uncore.funcs.force_wake_get(dev_priv, FORCEWAKE_ALL);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend? -Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -1
 	I915_WRITE(GEN6_RC_CONTROL, 0);
 
--

1.8.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

#3 lore raw
Quoted 3 lines · Deepak
Quoted 1 line

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend?

Yes Daniel, this was sequence recommended when going into suspend/Resume path.

So the BIOS falls over if we don't do this? In that case I think we need to reword the code comment to say that we're doing this for the BIOS. Otherwise someone will remove this again, since our own code surely doesn't need it.
-Daniel

Quoted 51 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, December 9, 2013 1:31 PM
To: S, Deepak
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Bring UP Power Wells before disabling RC6.

Quoted 16 lines · On Sun, Dec 08, 2013 at 01:52:46PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Instead of waiting for HW to bringup the wells, We force the wells up before disabling RC6. This is to avoid any register access when wells are down.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_pm.c index 2e1340f..089712a 100644

drivers/gpu/drm/i915/intel_pm.c static void gen6_disable_rps(struct drm_device · line 3668

Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
@@ -3661,6 +3661,12 @@ static void gen6_disable_rps(struct drm_device 
 *dev)  static void valleyview_disable_rps(struct drm_device *dev)  {
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long irqflags;
+
+	/* We need to bring up the wells before disabling the RC6 */
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+	dev_priv->uncore.funcs.force_wake_get(dev_priv, FORCEWAKE_ALL);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend? -Daniel

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -1
 	I915_WRITE(GEN6_RC_CONTROL, 0);
 
--

1.8.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
author
#4 lore raw

We faced some issue for not following the sequence.

I will add proper commit message and send it for review.

-Deepak

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, December 9, 2013 10:49 PM
To: S, Deepak
Cc: Daniel Vetter; [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Bring UP Power Wells before disabling RC6.

Quoted 3 lines · Deepak
Quoted 1 line

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend?

Yes Daniel, this was sequence recommended when going into suspend/Resume path.

So the BIOS falls over if we don't do this? In that case I think we need to reword the code comment to say that we're doing this for the BIOS. Otherwise someone will remove this again, since our own code surely doesn't need it.
-Daniel

Quoted 49 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of
Daniel Vetter
Sent: Monday, December 9, 2013 1:31 PM
To: S, Deepak
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH 2/3] drm/i915: Bring UP Power Wells before disabling RC6.

Quoted 18 lines · On Sun, Dec 08, 2013 at 01:52:46PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Instead of waiting for HW to bringup the wells, We force the wells up before disabling RC6. This is to avoid any register access when wells are down.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_pm.c index 2e1340f..089712a 100644

drivers/gpu/drm/i915/intel_pm.c +0 -0
@@ -3661,6 +3661,12 @@ static void gen6_disable_rps(struct 

drm_device
*dev) static void valleyview_disable_rps(struct drm_device *dev) {

drivers/gpu/drm/i915/intel_pm.c static void gen6_disable_rps(struct drm_device *dev) · line 3669

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +6 -0
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	unsigned long irqflags;
+
+	/* We need to bring up the wells before disabling the RC6 */
+	spin_lock_irqsave(&dev_priv->uncore.lock, irqflags);
+	dev_priv->uncore.funcs.force_wake_get(dev_priv, FORCEWAKE_ALL);
+	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);

What precisely does this fix? All our register access is already wrapped in get/put calls, so I'm a bit confused ... Is this to work around hw issues, or is this what the bios expects when going into suspend? -Daniel

Quoted 10 lines

I915_WRITE(GEN6_RC_CONTROL, 0);

--
1.8.4.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 4 lines

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch