]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: fix queue_reset_timeout_locked
authorChia-I Wu <olvaffe@gmail.com>
Tue, 2 Dec 2025 17:40:28 +0000 (09:40 -0800)
committerLiviu Dudau <liviu.dudau@arm.com>
Wed, 3 Dec 2025 13:44:21 +0000 (13:44 +0000)
queue_check_job_completion calls queue_reset_timeout_locked to reset the
timeout when progress is made. We want the reset to happen when the
timeout is running, not when it is suspended.

Fixes: 345c5b7cc0f85 ("drm/panthor: Make the timeout per-queue instead of per-job")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20251202174028.1600218-1-olvaffe@gmail.com
drivers/gpu/drm/panthor/panthor_sched.c

index 203f6a0a6b9ab53ac5cbaafa55151443e1261c19..33b9ef537e3593b6b4e65ec0d98e3a7681f34ce9 100644 (file)
@@ -1051,18 +1051,6 @@ group_is_idle(struct panthor_group *group)
        return hweight32(inactive_queues) == group->queue_count;
 }
 
-static void
-queue_reset_timeout_locked(struct panthor_queue *queue)
-{
-       lockdep_assert_held(&queue->fence_ctx.lock);
-
-       if (queue->timeout.remaining != MAX_SCHEDULE_TIMEOUT) {
-               mod_delayed_work(queue->scheduler.timeout_wq,
-                                &queue->timeout.work,
-                                msecs_to_jiffies(JOB_TIMEOUT_MS));
-       }
-}
-
 static bool
 group_can_run(struct panthor_group *group)
 {
@@ -1079,6 +1067,18 @@ queue_timeout_is_suspended(struct panthor_queue *queue)
        return queue->timeout.remaining != MAX_SCHEDULE_TIMEOUT;
 }
 
+static void
+queue_reset_timeout_locked(struct panthor_queue *queue)
+{
+       lockdep_assert_held(&queue->fence_ctx.lock);
+
+       if (!queue_timeout_is_suspended(queue)) {
+               mod_delayed_work(queue->scheduler.timeout_wq,
+                                &queue->timeout.work,
+                                msecs_to_jiffies(JOB_TIMEOUT_MS));
+       }
+}
+
 static void
 queue_suspend_timeout_locked(struct panthor_queue *queue)
 {