From 01f6f6ff7cf1ccaeaed2354b1b9a835551eaf2eb Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 17 Jul 2024 19:20:16 +0900 Subject: [PATCH] drm/asahi: workqueue: Tweak some debug logs Silence some logs that are possible and harmless in rare cases, add more debug to another log that is questionable. Signed-off-by: Asahi Lina --- drivers/gpu/drm/asahi/workqueue.rs | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/asahi/workqueue.rs b/drivers/gpu/drm/asahi/workqueue.rs index 23a6f992cf952f..ba0894c869f566 100644 --- a/drivers/gpu/drm/asahi/workqueue.rs +++ b/drivers/gpu/drm/asahi/workqueue.rs @@ -361,7 +361,16 @@ impl Job::ver { } else if let Some(work) = inner.pending.first() { Some(work.get_fence()) } else { - pr_err!("WorkQueue: Cannot submit, but queue is empty?\n"); + pr_err!( + "WorkQueue: Cannot submit, but queue is empty? {} > {}, {} > {} (pend={} ls={:#x?} lc={:#x?})\n", + inner.free_slots(), + self.event_count, + inner.free_space(), + self.pending.len(), + inner.pending.len(), + inner.last_submitted, + inner.last_completed, + ); None } } @@ -739,7 +748,11 @@ impl WorkQueue for WorkQueue::ver { let event = inner.event.as_ref(); let value = match event { None => { - pr_err!("WorkQueue: signal() called but no event?\n"); + mod_pr_debug!("WorkQueue: signal() called but no event?\n"); + + if inner.pending_jobs > 0 || !inner.pending.is_empty() { + pr_crit!("WorkQueue: signal() called with no event and pending jobs.\n"); + } return true; } Some(event) => event.0.current(), @@ -836,7 +849,11 @@ impl WorkQueue for WorkQueue::ver { let mut inner = self.inner.lock(); if inner.event.is_none() { - pr_err!("WorkQueue: signal_fault() called but no event?\n"); + mod_pr_debug!("WorkQueue: signal_fault() called but no event?\n"); + + if inner.pending_jobs > 0 || !inner.pending.is_empty() { + pr_crit!("WorkQueue: signal_fault() called with no event and pending jobs.\n"); + } return; } @@ -865,7 +882,11 @@ impl WorkQueue for WorkQueue::ver { let mut inner = self.inner.lock(); if inner.event.is_none() { - pr_err!("WorkQueue: fail_all() called but no event?\n"); + mod_pr_debug!("WorkQueue: fail_all() called but no event?\n"); + + if inner.pending_jobs > 0 || !inner.pending.is_empty() { + pr_crit!("WorkQueue: fail_all() called with no event and pending jobs.\n"); + } return; }