Skip to contentSkip to conversation

drm/xe: Invert runnable_state / pending enable check and assert

PATCH In review Matthew Brost 3 participants 3 messages Jun 13, 2024

Subsystems (2)
lore
Share & tools
lore

Matthew Brost

author maintainer
#0 lore raw

PATCH 1/1 drm/xe: Invert runnable_state / pending enable check and assert

Rather than checking for pending enable and asserting runnable_state == 1 in sched done handler, invert these. This is more robust code taking action based on the G2H message and asserting KMD tracking state is correct.

---
 drivers/gpu/drm/xe/xe_guc_submit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_guc_submit.c +2 -2
index 74552391dc5a..373447758a60 100644
@@ -1782,8 +1782,8 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
 {
 	trace_xe_exec_queue_scheduling_done(q);
 
-	if (exec_queue_pending_enable(q)) {
-		xe_gt_assert(guc_to_gt(guc), runnable_state == 1);
+	if (runnable_state == 1) {
+		xe_gt_assert(guc_to_gt(guc), exec_queue_pending_enable(q));
 
 		q->guc->resume_time = ktime_get();
 		clear_exec_queue_pending_enable(q);
Signature · 1 line
2.34.1
#1 lore raw

✗ CI.Patch_applied: failure for drm/xe: Invert runnable_state / pending enable check and assert

== Series Details ==

== Series Details ==

Series: drm/xe: Invert runnable_state / pending enable check and assert
URL : https://patchwork.freedesktop.org/series/134796/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-tip' with base: ===
Base commit: de4f2d210b33 drm-tip: 2024y-06m-12d-19h-26m-21s UTC integration manifest === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/xe_guc_submit.c:1782
error: drivers/gpu/drm/xe/xe_guc_submit.c: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: drm/xe: Invert runnable_state / pending enable check and assert Patch failed at 0001 drm/xe: Invert runnable_state / pending enable check and assert When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Reviewed-by on v1 1/1
#2 lore raw
In reply to Matthew Brost
Quoted 7 lines · Matthew Brost

Rather than checking for pending enable and asserting runnable_state == 1 in sched done handler, invert these. This is more robust code taking action based on the G2H message and asserting KMD tracking state is correct.

Quoted 19 lines
---
  drivers/gpu/drm/xe/xe_guc_submit.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_guc_submit.c +2 -2
index 74552391dc5a..373447758a60 100644
@@ -1782,8 +1782,8 @@ static void handle_sched_done(struct xe_guc *guc, struct xe_exec_queue *q,
  {
  	trace_xe_exec_queue_scheduling_done(q);
 
-	if (exec_queue_pending_enable(q)) {
-		xe_gt_assert(guc_to_gt(guc), runnable_state == 1);
+	if (runnable_state == 1) {
+		xe_gt_assert(guc_to_gt(guc), exec_queue_pending_enable(q));
 
  		q->guc->resume_time = ktime_get();
  		clear_exec_queue_pending_enable(q);