Skip to contentSkip to conversation

drm/i915/vlv: Remove check for Old Ack during forcewake

PATCH In review [email protected] 4 participants 6 messages Sep 17, 2014 – Sep 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/vlv: Remove check for Old Ack during forcewake

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
 drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -10
index 918b761..bcb0806 100644
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 {
 	/* Check for Render Engine */
 	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 
 		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
 	/* Check for Media Engine */
 	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
 		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · On Thu, Sep 18, 2014 at 06:51:50PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
 drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 918b761..bcb0806 100644

drivers/gpu/drm/i915/intel_uncore.c static void __vlv_force_wake_get(struct drm_i915_private *dev_priv, · line 199

Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 {
 	/* Check for Render Engine */
 	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 

Can we have a comment here? Something like this perhaps:

/*
* WaRsDontPollForAckOnClearingFWBits:vlv
* Hardware clears ack bits lazily (only when all ack
* bits become 0) so don't poll for individiual ack
* bits to be clear here.
*/

Apart from that:

Quoted 21 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
 		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
 	/* Check for Media Engine */
 	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
 		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
#2 lore raw
Quoted 41 lines · Ville Syrjälä
Quoted 21 lines · On Thu, Sep 18, 2014 at 06:51:50PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
 drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 918b761..bcb0806 100644

drivers/gpu/drm/i915/intel_uncore.c static void __vlv_force_wake_get(struct drm_i915_private *dev_priv, · line 199

Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 {
 	/* Check for Render Engine */
 	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 

Can we have a comment here? Something like this perhaps:

/*
* WaRsDontPollForAckOnClearingFWBits:vlv
* Hardware clears ack bits lazily (only when all ack
* bits become 0) so don't poll for individiual ack
* bits to be clear here.
*/

Quoted 2 lines

Apart from that:

Shouldn't this be Cc: [email protected]?
-Daniel

Quoted 26 lines
Quoted 22 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
 		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
 	/* Check for Media Engine */
 	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
 		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
Quoted 42 lines · Daniel Vetter
Quoted 41 lines · Ville Syrjälä
Quoted 21 lines · On Thu, Sep 18, 2014 at 06:51:50PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
 drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 918b761..bcb0806 100644

drivers/gpu/drm/i915/intel_uncore.c static void __vlv_force_wake_get(struct drm_i915_private *dev_priv, · line 199

Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 {
 	/* Check for Render Engine */
 	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 

Can we have a comment here? Something like this perhaps:

/*
* WaRsDontPollForAckOnClearingFWBits:vlv
* Hardware clears ack bits lazily (only when all ack
* bits become 0) so don't poll for individiual ack
* bits to be clear here.
*/

Quoted 4 lines
Quoted 2 lines

Apart from that:

Shouldn't this be Cc: [email protected]?

Perhaps. But on the other hand LRI to display registers is busted on VLV so the ddx doesn't do scanline waits which means it doesn't poke at the forcewake bits either. So only the KERNEL bit gets poked and so it should be quite impossible to encounter this issue with current userspace. Which probably explains why no one has ever reported it, or at least I don't remember seeing such a report myself.

Quoted 33 lines

-Daniel

Quoted 26 lines
Quoted 22 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
 		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
 	/* Check for Media Engine */
 	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
 		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
 				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 2 lines
Ville Syrjälä
Intel OTC
#4 lore raw
Quoted 44 lines · Ville Syrjälä
Quoted 43 lines · Daniel Vetter
Quoted 42 lines · Ville Syrjälä
Quoted 21 lines · On Thu, Sep 18, 2014 at 06:51:50PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
  drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
  1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 918b761..bcb0806 100644

drivers/gpu/drm/i915/intel_uncore.c static void __vlv_force_wake_get(struct drm_i915_private *dev_priv, · line 199

Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
  {
  	/* Check for Render Engine */
  	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 

Can we have a comment here? Something like this perhaps:

/*
* WaRsDontPollForAckOnClearingFWBits:vlv
* Hardware clears ack bits lazily (only when all ack
* bits become 0) so don't poll for individiual ack
* bits to be clear here.
*/

Apart from that:

Quoted 10 lines
Quoted 1 line

Shouldn't this be Cc: [email protected]?

Perhaps. But on the other hand LRI to display registers is busted on VLV so the ddx doesn't do scanline waits which means it doesn't poke at the forcewake bits either. So only the KERNEL bit gets poked and so it should be quite impossible to encounter this issue with current userspace. Which probably explains why no one has ever reported it, or at least I don't remember seeing such a report myself.

Quoted 1 line

-Daniel

Your right, with current userspace we should not see the issue. But if user space starts using other forcewake bits, we might endup hanging the system due to wait for OLD Ack. Advice from HW team was to avoid this check.

Thanks
Deepak

Quoted 28 lines
Quoted 28 lines
Quoted 24 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
  		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
  				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
  	/* Check for Media Engine */
  	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
  		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
  				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw
In reply to Ville Syrjälä
Quoted 40 lines · Ville Syrjälä
Quoted 21 lines · On Thu, Sep 18, 2014 at 06:51:50PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

Based on the HW team inputs. We can should not wait for the old ack, Waiting for old ack might fail, when other forcewake came before the present one is desserted.

for example, if forcewake bit 0 was set and before it could get cleared forcewake bit 1 got set, HW eventually clear bit 0, when the bit 1 is cleared. i.e, bit 1 is still sent then forcewake bit 0 will still be set.

---
  drivers/gpu/drm/i915/intel_uncore.c | 10 ----------
  1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +0 -0
index 918b761..bcb0806 100644

drivers/gpu/drm/i915/intel_uncore.c static void __vlv_force_wake_get(struct drm_i915_private *dev_priv, · line 199

Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
@@ -196,11 +196,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
  {
  	/* Check for Render Engine */
  	if (FORCEWAKE_RENDER & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Render forcewake old ack to clear.\n");
 

Can we have a comment here? Something like this perhaps:

/*
* WaRsDontPollForAckOnClearingFWBits:vlv
* Hardware clears ack bits lazily (only when all ack
* bits become 0) so don't poll for individiual ack
* bits to be clear here.
*/

Quoted 2 lines

Apart from that:

Thanks Ville, I will change the commit message.

Quoted 21 lines
Quoted 21 lines
drivers/gpu/drm/i915/intel_uncore.c +0 -5
  		__raw_i915_write32(dev_priv, FORCEWAKE_VLV,
  				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
@@ -214,11 +209,6 @@ static void __vlv_force_wake_get(struct drm_i915_private *dev_priv,
 
  	/* Check for Media Engine */
  	if (FORCEWAKE_MEDIA & fw_engine) {
-		if (wait_for_atomic((__raw_i915_read32(dev_priv,
-						FORCEWAKE_ACK_MEDIA_VLV) &
-						FORCEWAKE_KERNEL) == 0,
-					FORCEWAKE_ACK_TIMEOUT_MS))
-			DRM_ERROR("Timed out: Media forcewake old ack to clear.\n");
 
  		__raw_i915_write32(dev_priv, FORCEWAKE_MEDIA_VLV,
  				   _MASKED_BIT_ENABLE(FORCEWAKE_KERNEL));
Signature · 6 lines
1.9.1

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