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 C48CECCF9F8 for ; Thu, 6 Nov 2025 16:20:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C2A410E94E; Thu, 6 Nov 2025 16:20:55 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 18BE610E94B for ; Thu, 6 Nov 2025 16:20:54 +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 EA47F12FC; Thu, 6 Nov 2025 08:20:45 -0800 (PST) Received: from [10.57.72.2] (unknown [10.57.72.2]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 112AA3F66E; Thu, 6 Nov 2025 08:20:51 -0800 (PST) Message-ID: <8a1dd381-9173-46de-91a9-8cfdab9a269b@arm.com> Date: Thu, 6 Nov 2025 16:20:50 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 4/8] drm/panthor: Fix the full_tick check To: Boris Brezillon , Liviu Dudau , =?UTF-8?Q?Adri=C3=A1n_Larumbe?= Cc: dri-devel@lists.freedesktop.org, Florent Tomasin , Heinrich Fink , kernel@collabora.com References: <20251106144656.1012274-1-boris.brezillon@collabora.com> <20251106144656.1012274-5-boris.brezillon@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20251106144656.1012274-5-boris.brezillon@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 06/11/2025 14:46, Boris Brezillon wrote: > We have a full tick when the remaining time to the next tick is zero, > not the other way around. Declare a full_tick variable so we don't get > that test wrong in other places. > > Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block") > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price > --- > drivers/gpu/drm/panthor/panthor_sched.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c > index 69cc1b4c23f2..b6489e9ba1f0 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -2349,6 +2349,7 @@ static void tick_work(struct work_struct *work) > u64 remaining_jiffies = 0, resched_delay; > u64 now = get_jiffies_64(); > int prio, ret, cookie; > + bool full_tick; > > if (!drm_dev_enter(&ptdev->base, &cookie)) > return; > @@ -2360,15 +2361,17 @@ static void tick_work(struct work_struct *work) > if (time_before64(now, sched->resched_target)) > remaining_jiffies = sched->resched_target - now; > > + full_tick = remaining_jiffies == 0; > + > mutex_lock(&sched->lock); > if (panthor_device_reset_is_pending(sched->ptdev)) > goto out_unlock; > > - tick_ctx_init(sched, &ctx, remaining_jiffies != 0); > + tick_ctx_init(sched, &ctx, full_tick); > if (ctx.csg_upd_failed_mask) > goto out_cleanup_ctx; > > - if (remaining_jiffies) { > + if (!full_tick) { > /* Scheduling forced in the middle of a tick. Only RT groups > * can preempt non-RT ones. Currently running RT groups can't be > * preempted.