Skip to content

Commit 149aabc

Browse files
vireshkKAGA-KOKO
authored andcommitted
clockevents: Shutdown detached clockevent device
A clockevent device is marked DETACHED when it is replaced by another clockevent device. The device is shutdown properly for drivers that implement legacy ->set_mode() callback, as we call ->set_mode() for CLOCK_EVT_MODE_UNUSED as well. But for the new per-state callback interface, we skip shutting down the device, as we thought its an internal state change. That wasn't correct. The effect is that the device is left programmed in oneshot or periodic mode. Fall-back to 'case CLOCK_EVT_STATE_SHUTDOWN', to shutdown the device. Fixes: bd624d7 "clockevents: Introduce mode specific callbacks" Reported-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: linaro-kernel@lists.linaro.org Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/eef0a91c51b74d4e52c8e5a95eca27b5a0563f07.1428650683.git.viresh.kumar@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 646da63 commit 149aabc

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

kernel/time/clockevents.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ static int __clockevents_set_state(struct clock_event_device *dev,
117117
/* Transition with new state-specific callbacks */
118118
switch (state) {
119119
case CLOCK_EVT_STATE_DETACHED:
120-
/*
121-
* This is an internal state, which is guaranteed to go from
122-
* SHUTDOWN to DETACHED. No driver interaction required.
123-
*/
124-
return 0;
120+
/* The clockevent device is getting replaced. Shut it down. */
125121

126122
case CLOCK_EVT_STATE_SHUTDOWN:
127123
return dev->set_state_shutdown(dev);

0 commit comments

Comments
 (0)