Skip to content

Commit

Permalink
core: callout: disable obsolete timeouts
Browse files Browse the repository at this point in the history
In callout_service_cb() when a timeout interrupt is received there's a
check to see if this is the last scheduled CPU. If not the interrupt is
ignored, but not disabled causing it to trigger again and again. So fix
this by disabling the timeout too.

Fixes: cf707bd ("core: add callout service")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jenswi-linaro committed May 2, 2024
1 parent d20a1d4 commit 8956d24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/kernel/callout.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,13 @@ void callout_service_cb(void)
* schedule_next_timeout() saves the core it was last
* called on. If there's a mismatch here it means that
* another core has been scheduled for the next callout, so
* there's no work to be done for this core.
* there's no work to be done for this core and we can
* disable the timeout on this CPU.
*/
cpu_spin_lock(&callout_sched_lock);
do_callout = (get_core_pos() == callout_sched_core);
if (!do_callout)
desc->disable_timeout(desc);
cpu_spin_unlock(&callout_sched_lock);
if (!do_callout)
return;
Expand Down

0 comments on commit 8956d24

Please sign in to comment.