History

rust: time: Pass correct timer mode ID to hrtimer_start_range_ns

While rebasing rvkms I noticed that timers I was setting seemed to have pretty random timer values that amounted slightly over 2x the time value I set each time. After a lot of debugging, I finally managed to figure out why: it seems that since we moved to Instant and Delta, we mistakenly began passing the clocksource ID to hrtimer_start_range_ns, when we should be passing the timer mode instead. Presumably, this works fine for simple relative timers - but immediately breaks on other types of timers. So, fix this by passing the ID for the timer mode instead.

Lyude Paul committed 1 year ago

Commit 23b128b1 parent 77580e81 file · +1 −1Browse files

Showing the changes to rust/kernel/time (1 of 1 file). Show all

Unified · Split

rust/kernel/time/hrtimer.rs+1−1
@@ -398,7 +398,7 @@ pub unsafe trait HasHrTimer<T> { · 397 unmodified lines
398398 Self::c_timer_ptr(this).cast_mut(),
399399 expires.as_nanos(),
400400 0,
401− <Self::TimerMode as HrTimerMode>::Clock::ID as u32,
401+ <Self::TimerMode as HrTimerMode>::C_MODE,
402402 );
403403 }
404404 }