Commit a3c2d0b4 authored by Boris Brezillon's avatar Boris Brezillon
Browse files

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: de854881 ("drm/panthor: Add the scheduler logical block")
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
Link: https://patch.msgid.link/20251128094839.3856402-4-boris.brezillon@collabora.com


Signed-off-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
parent 5232e849
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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.