Function clockevents_switch_state() will check whether it has already
switched to specified state, do nothing if it has.
In function tick_shutdown(), it will set detached state at first and
call clockevents_switch_state() in clockevents_exchange_device(). The
function clockevents_switch_state() will do nothing since it is already
detached state. So the tick timer device will not be shutdown when CPU
is offline.
Function tick_shutdown() did this because it was originally invoked
on a life CPU and not on the outgoing CPU. Now this function is called
on the outgoing CPU, the hardware device can be accessed.
Here remove state set before calling clockevents_exchange_device(),
its state will be set in function clockevents_switch_state() if it
succeeds to do so.
---
v2 ... v3:
1. Remove parameter cpu in function tick_shutdown() since it is called
on the outgoing CPU.
2. Modify stale comments about tick_shutdown().
v1 ... v2:
1. Add Fixes tag in patch 1 since those commits removed shutdown calls
made from drivers that assumed the timer core would do so.
2. Remove clockevents shutdown call on LoongArch cpu offline
---
Bibo Mao (2):
tick: Remove unreasonable detached state set in tick_shutdown()
LoongArch: Remove clockevents shutdown call on offlining
arch/loongarch/kernel/time.c | 2 --
kernel/time/clockevents.c | 2 +-
kernel/time/tick-common.c | 16 +++++-----------
kernel/time/tick-internal.h | 2 +-
4 files changed, 7 insertions(+), 15 deletions(-)
base-commit: d1d10cea0895264cc3769e4d9719baa94f4b250b
--
2.39.3