[PATCH 6.19 200/781] drm/panthor: fix queue_reset_timeout_locked

Greg Kroah-Hartman
2026-02-25T01:30:37Z

From: Chia-I Wu <olvaffe@gmail.com>

[ Upstream commit ac5b392a8c355001c4c3f230a0e4b1f904e359ca ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_sched.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index f53fa51d51694..6ac4cec52f9e4 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -1072,18 +1072,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)
{
@@ -1100,6 +1088,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)
{
--
2.51.0