Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panthor: Fix immediate ticking on a disabled tick

We have a few paths where we schedule the tick work immediately without
changing the resched_target. If the tick was stopped, this would lead
to a remaining_jiffies that's always > 0, and it wouldn't force a full
tick in that case. Add extra checks to cover that case properly.

v2:
- Fix typo
- Simplify the code as suggested by Steve

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-6-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

+7 -2
+7 -2
drivers/gpu/drm/panthor/panthor_sched.c
··· 2435 2435 tick_work.work); 2436 2436 struct panthor_device *ptdev = sched->ptdev; 2437 2437 struct panthor_sched_tick_ctx ctx; 2438 + u64 resched_target = sched->resched_target; 2438 2439 u64 remaining_jiffies = 0, resched_delay; 2439 2440 u64 now = get_jiffies_64(); 2440 2441 int prio, ret, cookie; ··· 2448 2447 if (drm_WARN_ON(&ptdev->base, ret)) 2449 2448 goto out_dev_exit; 2450 2449 2451 - if (time_before64(now, sched->resched_target)) 2452 - remaining_jiffies = sched->resched_target - now; 2450 + /* If the tick is stopped, calculate when the next tick would be */ 2451 + if (resched_target == U64_MAX) 2452 + resched_target = sched->last_tick + sched->tick_period; 2453 + 2454 + if (time_before64(now, resched_target)) 2455 + remaining_jiffies = resched_target - now; 2453 2456 2454 2457 full_tick = remaining_jiffies == 0; 2455 2458