* [PATCH v2] drm/panthor: fix queue_reset_timeout_locked
@ 2025-12-02 21:31 Chia-I Wu
2025-12-03 8:41 ` Boris Brezillon
2025-12-03 9:40 ` Liviu Dudau
0 siblings, 2 replies; 3+ messages in thread
From: Chia-I Wu @ 2025-12-02 21:31 UTC (permalink / raw)
To: Boris Brezillon, Steven Price, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Grant Likely, Heiko Stuebner, dri-devel, linux-kernel,
ashley.smith
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>
---
v2: reset queue->timeout.remaining when suspended (Boris)
---
drivers/gpu/drm/panthor/panthor_sched.c | 26 +++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index 389d508b3848e..95ae42168ce18 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -1052,18 +1052,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)
{
@@ -1080,6 +1068,20 @@ 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)) {
+ queue->timeout.remaining = msecs_to_jiffies(JOB_TIMEOUT_MS);
+ } else {
+ 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.52.0.158.g65b55ccf14-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] drm/panthor: fix queue_reset_timeout_locked
2025-12-02 21:31 [PATCH v2] drm/panthor: fix queue_reset_timeout_locked Chia-I Wu
@ 2025-12-03 8:41 ` Boris Brezillon
2025-12-03 9:40 ` Liviu Dudau
1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2025-12-03 8:41 UTC (permalink / raw)
To: Chia-I Wu
Cc: Steven Price, Liviu Dudau, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Grant Likely,
Heiko Stuebner, dri-devel, linux-kernel, ashley.smith
On Tue, 2 Dec 2025 13:31:02 -0800
Chia-I Wu <olvaffe@gmail.com> wrote:
> 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>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
>
> ---
> v2: reset queue->timeout.remaining when suspended (Boris)
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 26 +++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 389d508b3848e..95ae42168ce18 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -1052,18 +1052,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)
> {
> @@ -1080,6 +1068,20 @@ 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)) {
> + queue->timeout.remaining = msecs_to_jiffies(JOB_TIMEOUT_MS);
> + } else {
> + 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)
> {
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] drm/panthor: fix queue_reset_timeout_locked
2025-12-02 21:31 [PATCH v2] drm/panthor: fix queue_reset_timeout_locked Chia-I Wu
2025-12-03 8:41 ` Boris Brezillon
@ 2025-12-03 9:40 ` Liviu Dudau
1 sibling, 0 replies; 3+ messages in thread
From: Liviu Dudau @ 2025-12-03 9:40 UTC (permalink / raw)
To: Chia-I Wu
Cc: Boris Brezillon, Steven Price, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Grant Likely,
Heiko Stuebner, dri-devel, linux-kernel, ashley.smith
On Tue, Dec 02, 2025 at 01:31:02PM -0800, Chia-I Wu wrote:
> 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>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
>
> ---
> v2: reset queue->timeout.remaining when suspended (Boris)
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 26 +++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 389d508b3848e..95ae42168ce18 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -1052,18 +1052,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)
> {
> @@ -1080,6 +1068,20 @@ 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)) {
> + queue->timeout.remaining = msecs_to_jiffies(JOB_TIMEOUT_MS);
> + } else {
> + 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.52.0.158.g65b55ccf14-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-03 9:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 21:31 [PATCH v2] drm/panthor: fix queue_reset_timeout_locked Chia-I Wu
2025-12-03 8:41 ` Boris Brezillon
2025-12-03 9:40 ` Liviu Dudau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox