From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC9AD2D5A16 for ; Wed, 3 Dec 2025 09:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764754833; cv=none; b=GK+WrSPcVHwD/3216fbsb7XuYLGtm9TKXSEvZF7c+XyLmD/iarttel8zDxFBbmlNYQKfMNUaS7BPONM7KTd868HV3YIUf3p/hES7NTiXu6H52rvc3nN8PWOb2N156G76oo79FxGekGrXL3KDXTNuN8f++g8M/643jtg3aXxJRYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764754833; c=relaxed/simple; bh=h1Zi+0xPfbextXCTAmAr8IDzUt/zWgKZWiud4swUdt0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=koj9vgaDnDruXY8tBILlaWf5w30QLjoAEl2q+D1i1y7V9jDnSNwGetIRrBxVyhSMvSNjxrDeuJtEicaVXL5e1+BEVmXK6GXkWWecyTRA3x+OXMX9R3MZGXBjW0oNq8RGmkEvsWx1q51/1+6mJqo1XJapfQF31Ah9xX6Sau/1TWM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 B4FE4339 for ; Wed, 3 Dec 2025 01:40:23 -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 D79B03F59E for ; Wed, 3 Dec 2025 01:40:30 -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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251202213102.3197965-1-olvaffe@gmail.com> 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 >