Skip to content

Commit fe79a9b

Browse files
sorenb-xlnxKAGA-KOKO
authored andcommitted
clockevents: Adjust timer interval when frequency changes
clockevent devices in periodic mode are not updated when the frequency of the device changes. Issue a dev->set_mode() callback which forces the device to reevaluate the timer settings. Signed-off-by: Soren Brinkmann <[email protected]> Cc: [email protected] Cc: Daniel Lezcano <[email protected]> Cc: Michal Simek <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent 627ee79 commit fe79a9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/time/clockevents.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,13 @@ int __clockevents_update_freq(struct clock_event_device *dev, u32 freq)
443443
{
444444
clockevents_config(dev, freq);
445445

446-
if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
447-
return 0;
446+
if (dev->mode == CLOCK_EVT_MODE_ONESHOT)
447+
return clockevents_program_event(dev, dev->next_event, false);
448+
449+
if (dev->mode == CLOCK_EVT_MODE_PERIODIC)
450+
dev->set_mode(CLOCK_EVT_MODE_PERIODIC, dev);
448451

449-
return clockevents_program_event(dev, dev->next_event, false);
452+
return 0;
450453
}
451454

452455
/**

0 commit comments

Comments
 (0)