drm/panthor: Fix the full_tick check

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.

v2:
- Add R-b

v3:
- Collect R-b

Fixes: de85488138 ("drm/panthor: Add the scheduler logical block")
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Link: https://patch.msgid.link/20251128094839.3856402-4-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
This commit is contained in:
Boris Brezillon 2025-11-28 10:48:34 +01:00
parent 5232e84927
commit a3c2d0b40b

View File

@ -2448,6 +2448,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;
@ -2459,15 +2460,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.