]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: Fix the full_tick check
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 28 Nov 2025 09:48:34 +0000 (10:48 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Fri, 28 Nov 2025 09:56:44 +0000 (10:56 +0100)
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: de8548813824 ("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>
drivers/gpu/drm/panthor/panthor_sched.c

index 5ec553818c28f3084e1757065e6d96874383c5e2..5d280d9c82259421773f00cc15ca37471b3c149f 100644 (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.