From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CEB7D12696 for ; Wed, 3 Dec 2025 09:40:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7104910E764; Wed, 3 Dec 2025 09:40:31 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 53C9B10E760 for ; Wed, 3 Dec 2025 09:40:30 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9369E1477 for ; Wed, 3 Dec 2025 01:40:22 -0800 (PST) Received: from [10.2.10.34] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B2A493F59E for ; Wed, 3 Dec 2025 01:40:29 -0800 (PST) Date: Wed, 3 Dec 2025 09:40:02 +0000 From: Liviu Dudau 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@lists.freedesktop.org, linux-kernel@vger.kernel.org, ashley.smith@collabora.com Subject: Re: [PATCH v2] drm/panthor: fix queue_reset_timeout_locked Message-ID: References: <20251202213102.3197965-1-olvaffe@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251202213102.3197965-1-olvaffe@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Liviu Dudau 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 >