clockevents: Reset next_event_forced in the coupled programming path
PATCH 1/1 clockevents: Reset next_event_forced in the coupled programming path
All successful event programming paths in clockevents_program_event() reset next_event_forced to zero, except the clockevent_set_next_coupled() path which was added before the starvation prevention mechanism.
Add the missing reset for consistency.
--- kernel/time/clockevents.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/time/clockevents.c +3 -1
@@ -357,8 +357,10 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires, bif (unlikely (dev->features &CLOCK_EVT_FEAT_HRTIMER ))return dev->set_next_ktime (expires, dev); -if (likely (clockevent_set_next_coupled (dev, expires))) +if (likely (clockevent_set_next_coupled (dev, expires))) { + dev->next_event_forced =0 ;return 0 ; + } delta =ktime_to_ns (ktime_sub (expires,ktime_get ()));
Signature · 1 line
2.43.0
Thomas Gleixner
maintainerQuoted 5 lines · Zhan Xusheng
All successful event programming paths in
clockevents_program_event()resetnext_event_forcedto zero, except theclockevent_set_next_coupled()path which was added before the starvation prevention mechanism.Add the missing reset for consistency.
What for?
It never reaches the point where it sets or checks that next_event_forced bit.
Your AI slop is clearly not getting it.
Quoted 4 lines · Thomas Gleixner
What for?
It never reaches the point where it sets or checks that
next_event_forcedbit.
You're right. Devices using the coupled path never reach the code which sets or checks next_event_forced, so this reset is dead code.
Sorry for the noise.
Zhan Xusheng