diff options
| author | Boris Brezillon <boris.brezillon@collabora.com> | 2025-11-28 12:48:34 +0300 |
|---|---|---|
| committer | Boris Brezillon <boris.brezillon@collabora.com> | 2025-11-28 12:56:44 +0300 |
| commit | a3c2d0b40b108bd45d44f6c1dfa33c39d577adcd (patch) | |
| tree | d7a09148687f6dadd91dc5ba951ae28a1ed84ae3 | |
| parent | 5232e84927197d5cb045ddea9c90fc143b64bf65 (diff) | |
| download | linux-a3c2d0b40b108bd45d44f6c1dfa33c39d577adcd.tar.xz | |
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: 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>
| -rw-r--r-- | drivers/gpu/drm/panthor/panthor_sched.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c index 5ec553818c28..5d280d9c8225 100644 --- a/drivers/gpu/drm/panthor/panthor_sched.c +++ b/drivers/gpu/drm/panthor/panthor_sched.c @@ -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. |
