Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
clockevents: Adjust timer interval when frequency changes
Browse files Browse the repository at this point in the history
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 <soren.brinkmann@xilinx.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Link: http://lkml.kernel.org/r/1391466877-28908-3-git-send-email-soren.brinkmann@xilinx.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
sorenb-xlnx authored and KAGA-KOKO committed Feb 7, 2014
1 parent 627ee79 commit fe79a9b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kernel/time/clockevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,13 @@ int __clockevents_update_freq(struct clock_event_device *dev, u32 freq)
{
clockevents_config(dev, freq);

if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
return 0;
if (dev->mode == CLOCK_EVT_MODE_ONESHOT)
return clockevents_program_event(dev, dev->next_event, false);

if (dev->mode == CLOCK_EVT_MODE_PERIODIC)
dev->set_mode(CLOCK_EVT_MODE_PERIODIC, dev);

return clockevents_program_event(dev, dev->next_event, false);
return 0;
}

/**
Expand Down

0 comments on commit fe79a9b

Please sign in to comment.