* [tip: timers/urgent] alarmtimer: Fix argument order in alarm_timer_forward()
[not found] <20260323061130.29991-1-zhanxusheng@xiaomi.com>
@ 2026-03-24 22:21 ` tip-bot2 for Zhan Xusheng
0 siblings, 0 replies; only message in thread
From: tip-bot2 for Zhan Xusheng @ 2026-03-24 22:21 UTC (permalink / raw)
To: linux-tip-commits
Cc: Zhan Xusheng, Thomas Gleixner, stable, x86, linux-kernel
The following commit has been merged into the timers/urgent branch of tip:
Commit-ID: 5d16467ae56343b9205caedf85e3a131e0914ad8
Gitweb: https://git.kernel.org/tip/5d16467ae56343b9205caedf85e3a131e0914ad8
Author: Zhan Xusheng <zhanxusheng1024@gmail.com>
AuthorDate: Mon, 23 Mar 2026 14:11:30 +08:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 24 Mar 2026 23:17:14 +01:00
alarmtimer: Fix argument order in alarm_timer_forward()
alarm_timer_forward() passes arguments to alarm_forward() in the wrong
order:
alarm_forward(alarm, timr->it_interval, now);
However, alarm_forward() is defined as:
u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
and uses the second argument as the current time:
delta = ktime_sub(now, alarm->node.expires);
Passing the interval as "now" results in incorrect delta computation,
which can lead to missed expirations or incorrect overrun accounting.
This issue has been present since the introduction of
alarm_timer_forward().
Fix this by swapping the arguments.
Fixes: e7561f1633ac ("alarmtimer: Implement forward callback")
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260323061130.29991-1-zhanxusheng@xiaomi.com
---
kernel/time/alarmtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 069d93b..b64db40 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -540,7 +540,7 @@ static s64 alarm_timer_forward(struct k_itimer *timr, ktime_t now)
{
struct alarm *alarm = &timr->it.alarm.alarmtimer;
- return alarm_forward(alarm, timr->it_interval, now);
+ return alarm_forward(alarm, now, timr->it_interval);
}
/**
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-24 22:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260323061130.29991-1-zhanxusheng@xiaomi.com>
2026-03-24 22:21 ` [tip: timers/urgent] alarmtimer: Fix argument order in alarm_timer_forward() tip-bot2 for Zhan Xusheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox