From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A2D52D592A for ; Wed, 3 Dec 2025 08:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764751274; cv=none; b=Vvk9mQuNdEIwo9rKypaSNRvbtUAVesFs1PzqslQPxH4vTIwiYnkN4Qu5du0IRBTdI/HwsID53h4q0wh0IJa3D0uXZfo9fzc70wPt3CXLwjkGbbs2pYJhucd2bteV9TM3anhPhnmSlGn+hLln+6LK2aDRaPQI1noooRCZL6HDX5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764751274; c=relaxed/simple; bh=6gTuGhZDLkFh7ZSvz2w/jiQ0tRF82fhRTaidi20+ySE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ff+EOij0bz4WoPnBYCuHHaGcp/b8XiZd0L2ccpaK2cF9AaHmr7eSATf46Jr/ODbvFPR2bNvTUbxEhkKjDswI0Wli4M1i6oRZiioPEChmYSyI7o34RLNCKlBH1CxvMhHFsIwiF5Nwj4ffz9GpkBwSt+oeBL/8O64o+plNRdQK9kQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=SSDW05lA; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="SSDW05lA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1764751265; bh=6gTuGhZDLkFh7ZSvz2w/jiQ0tRF82fhRTaidi20+ySE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SSDW05lAMS8UGN+1jd1tK2DzEc0gE4yriMdoMya5CG7z7Nz/cGPIvD9qLPWmVWfW7 LaDV9DkzkQ/ZmW5okUCti3QBdfiQNSq2VnjHG7zjabTegtOcRiw+k/AXWg1URhbs6G zqoT3nB/yUWudiDMIfki3SA7wvlLMuZgF35ob3EggzTu0C/tnPE/S5bZw/Cg2pG63c yoNHuWqqQ+ohEZqaLcHm48n/QllTWTXFNb9zx9/wiMBeuro7y7YucHT4W9ISjMxmak eIBD43mQIWu/x8FeJJbi8oKUGG/dt7t7dIBKJHgRadIgAFOrW+oA2UJV/0fPLXyL8i Dib2FjV+i5Y0g== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id B5F3C17E10E7; Wed, 3 Dec 2025 09:41:04 +0100 (CET) Date: Wed, 3 Dec 2025 09:41:00 +0100 From: Boris Brezillon 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@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: <20251203094100.5b07fc0b@fedora> In-Reply-To: <20251202213102.3197965-1-olvaffe@gmail.com> References: <20251202213102.3197965-1-olvaffe@gmail.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 2 Dec 2025 13:31:02 -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: Boris Brezillon > > --- > 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) > {