diff options
author | Walter Chang <[email protected]> | 2023-07-17 17:07:34 +0800 |
---|---|---|
committer | Daniel Lezcano <[email protected]> | 2023-08-18 12:06:16 +0200 |
commit | e7d65e40ab5a5940785c5922f317602d0268caaf (patch) | |
tree | decb4c212153d96ba175da929c3705aaf81533f0 /lib/memory-notifier-error-inject.c | |
parent | c42b7a385286a99024ed2e6c2566929083b49ec8 (diff) |
clocksource/drivers/arm_arch_timer: Disable timer before programming CVAL
Due to the fact that the use of `writeq_relaxed()` to program CVAL is
not guaranteed to be atomic, it is necessary to disable the timer before
programming CVAL.
However, if the MMIO timer is already enabled and has not yet expired,
there is a possibility of unexpected behavior occurring: when the CPU
enters the idle state during this period, and if the CPU's local event
is earlier than the broadcast event, the following process occurs:
tick_broadcast_enter()
tick_broadcast_oneshot_control(TICK_BROADCAST_ENTER)
__tick_broadcast_oneshot_control()
___tick_broadcast_oneshot_control()
tick_broadcast_set_event()
clockevents_program_event()
set_next_event_mem()
During this process, the MMIO timer remains enabled while programming
CVAL. To prevent such behavior, disable timer explicitly prior to
programming CVAL.
Fixes: 8b82c4f883a7 ("clocksource/drivers/arm_arch_timer: Move MMIO timer programming over to CVAL")
Cc: [email protected]
Signed-off-by: Walter Chang <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions