Skip to contentSkip to conversation

drm/i915: Check idle to active before processing CSQ

PATCH Applied Mika Kuoppala 4 participants 7 messages Aug 6, 2015 – Aug 12, 2015

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

PATCH 1/1 drm/i915: Check idle to active before processing CSQ

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

---
 drivers/gpu/drm/i915/intel_lrc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_lrc.c +3 -0
index 99bba8e..96218bf 100644
@@ -497,6 +497,9 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring)
 		status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
 				(read_pointer % 6) * 8 + 4);
 
+		if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
+			continue;
+
 		if (status & GEN8_CTX_STATUS_PREEMPTED) {
 			if (status & GEN8_CTX_STATUS_LITE_RESTORE) {
 				if (execlists_check_remove_request(ring, status_id))
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 7 lines · Mika Kuoppala

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

Same questions here too, what's the impact. E.g. if you only found this by bspec/code inspection then it's for -next, but if it's to fix some known breakage then it's for -fixes + cc: stable.

Thanks, Daniel

Quoted 25 lines
---
 drivers/gpu/drm/i915/intel_lrc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_lrc.c +3 -0
index 99bba8e..96218bf 100644
@@ -497,6 +497,9 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring)
 		status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
 				(read_pointer % 6) * 8 + 4);
 
+		if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
+			continue;
+
 		if (status & GEN8_CTX_STATUS_PREEMPTED) {
 			if (status & GEN8_CTX_STATUS_LITE_RESTORE) {
 				if (execlists_check_remove_request(ring, status_id))
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Mika Kuoppala

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Quoted 9 lines
Quoted 4 lines

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

Same questions here too, what's the impact. E.g. if you only found this by bspec/code inspection then it's for -next, but if it's to fix some known breakage then it's for -fixes + cc: stable.

To this and the masked write one: Both of these were found when I was trying to find out root cause for skl hangs.

They are both for -next. Both are in the correctness department vrt bspec and I haven't observed any other impact.

Point taken on being more verbose.

-Mika

Quoted 23 lines

Thanks, Daniel

Quoted 21 lines
---
 drivers/gpu/drm/i915/intel_lrc.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_lrc.c +3 -0
index 99bba8e..96218bf 100644
@@ -497,6 +497,9 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring)
 		status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
 				(read_pointer % 6) * 8 + 4);
 
+		if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
+			continue;
+
 		if (status & GEN8_CTX_STATUS_PREEMPTED) {
 			if (status & GEN8_CTX_STATUS_LITE_RESTORE) {
 				if (execlists_check_remove_request(ring, status_id))
Signature · 1 line
2.1.4
Quoted 9 lines
Quoted 4 lines

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

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

#3 lore raw
Quoted 16 lines · Mika Kuoppala
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Mika Kuoppala

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Quoted 9 lines
Quoted 4 lines

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

Same questions here too, what's the impact. E.g. if you only found this by bspec/code inspection then it's for -next, but if it's to fix some known breakage then it's for -fixes + cc: stable.

Quoted 8 lines

To this and the masked write one: Both of these were found when I was trying to find out root cause for skl hangs.

They are both for -next. Both are in the correctness department vrt bspec and I haven't observed any other impact.

Point taken on being more verbose.

Thanks I added a note about this to the first patch and merged it. This one here still seems to miss an r-b.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by
#4 lore raw
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Mika Kuoppala
Quoted 1 line · Daniel Vetter

On Thu, Aug 06, 2015 at 05:09:17PM +0300, Mika Kuoppala wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

looks good to me, didn't observe any impact with this patch.

regards
Arun

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines

Same questions here too, what's the impact. E.g. if you only found this by bspec/code inspection then it's for -next, but if it's to fix some known breakage then it's for -fixes + cc: stable.

To this and the masked write one: Both of these were found when I was trying to find out root cause for skl hangs.

They are both for -next. Both are in the correctness department vrt bspec and I haven't observed any other impact.

Quoted 6 lines
Quoted 1 line

Point taken on being more verbose.

Thanks I added a note about this to the first patch and merged it. This one here still seems to miss an r-b.
-Daniel

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

#5 lore raw
Quoted 8 lines · Arun
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Mika Kuoppala
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Mika Kuoppala

If idle to active bit is set, the rest of the fields in CSQ are not valid.

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Bail out early if this is the case in order to prevent rest of the loop inspecting stale values.

looks good to me, didn't observe any impact with this patch.

Queued for -next, thanks for the patch.
-Daniel

Quoted 23 lines

regards
Arun

Quoted 18 lines
Quoted 5 lines
Quoted 4 lines

Same questions here too, what's the impact. E.g. if you only found this by bspec/code inspection then it's for -next, but if it's to fix some known breakage then it's for -fixes + cc: stable.

Quoted 8 lines

To this and the masked write one: Both of these were found when I was trying to find out root cause for skl hangs.

They are both for -next. Both are in the correctness department vrt bspec and I haven't observed any other impact.

Point taken on being more verbose.

Thanks I added a note about this to the first patch and merged it. This one here still seems to miss an r-b.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#6 lore raw
In reply to Mika Kuoppala

Task id: 7109 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

ILK                                  302/302              302/302
SNB                                  315/315              315/315
IVB                                  336/336              336/336
BYT                                  283/283              283/283
HSW                                  378/378              378/378

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx