30 May, 2013
1 commit
-
Add functions needed for hooking up alarmtimer to timerfd:
* alarm_restart: Similar to hrtimer_restart, restart an alarmtimer after
the expires time has already been updated (as with alarm_forward).* alarm_forward_now: Similar to hrtimer_forward_now, move the expires
time forward to an interval from the current time of the associated clock.* alarm_start_relative: Start an alarmtimer with an expires time relative to
the current time of the associated clock.* alarm_expires_remaining: Similar to hrtimer_expires_remaining, return the
amount of time remaining until alarm expiry.Signed-off-by: Todd Poynor
Signed-off-by: John Stultz
25 Sep, 2012
2 commits
-
No one is using these alarmtimer state helpers, so yank them.
Cc: Arve Hjønnevåg
Cc: Colin Cross
Cc: Thomas Gleixner
Signed-off-by: John Stultz -
Arve Hjønnevåg reported numerous crashes from the
"BUG_ON(timer->state != HRTIMER_STATE_CALLBACK)" check
in __run_hrtimer after it called alarmtimer_fired.It ends up the alarmtimer code was not properly handling
possible failures of hrtimer_try_to_cancel, and because
these faulres occur when the underlying base hrtimer is
being run, this limits the ability to properly handle
modifications to any alarmtimers on that base.Because much of the logic duplicates the hrtimer logic,
it seems that we might as well have a per-alarmtimer
hrtimer, and avoid the extra complextity of trying to
multiplex many alarmtimers off of one hrtimer.Thus this patch moves the hrtimer to the alarm structure
and simplifies the management logic.Changelog:
v2:
* Includes a fix for double alarm_start calls found by
ArveCc: Arve Hjønnevåg
Cc: Colin Cross
Cc: Thomas Gleixner
Reported-by: Arve Hjønnevåg
Tested-by: Arve Hjønnevåg
Signed-off-by: John Stultz
21 Apr, 2012
1 commit
-
The Android alarm interface provides a settime call that sets both
the alarmtimer RTC device and CLOCK_REALTIME to the same value.Since there may be multiple rtc devices, provide a hook to access the
one the alarmtimer infrastructure is using.CC: Colin Cross
CC: Thomas Gleixner
CC: Android Kernel Team
Signed-off-by: John Stultz
Signed-off-by: Greg Kroah-Hartman
11 Aug, 2011
5 commits
-
There's a number of edge cases when cancelling a alarm, so
to be sure we accurately do so, introduce try_to_cancel, which
returns proper failure errors if it cannot. Also modify cancel
to spin until the alarm is properly disabled.CC: Thomas Gleixner
Signed-off-by: John Stultz -
In order to allow for functionality like try_to_cancel, add
more refined state tracking (similar to hrtimers).CC: Thomas Gleixner
Signed-off-by: John Stultz -
Now that periodic alarmtimers are managed by the handler function,
remove the period value from the alarm structure and let the handlers
manage the interval on their own.CC: Thomas Gleixner
Signed-off-by: John Stultz -
In order to avoid wasting time expiring and re-adding very high freq
periodic alarmtimers, introduce alarm_forward() which is similar to
hrtimer_forward and moves the timer to the next future expiration time
and returns the number of overruns.CC: Thomas Gleixner
Signed-off-by: John Stultz -
In order to properly fix the denial of service issue with high freq
periodic alarm timers, we need to push the re-arming logic into the
alarm timer handler, much as the hrtimer code does.This patch introduces alarmtimer_restart enum and changes the
alarmtimer handler declarations to use it as a return value. Further,
to ease following changes, it extends the alarmtimer handler functions
to also take the time at expiration. No logic is yet modified.CC: Thomas Gleixner
Signed-off-by: John Stultz
29 Apr, 2011
1 commit
-
This patch addresses a number of minor comment improvements and
other minor issues from Thomas' review of the alarmtimers code.CC: Thomas Gleixner
Signed-off-by: John Stultz
27 Apr, 2011
1 commit
-
This provides the in kernel interface and infrastructure for
alarm-timers.Alarm-timers are a hybrid style timer, similar to hrtimers,
but when the system is suspended, the RTC device is set to
fire and wake the system for when the soonest alarm-timer
expires.The concept for Alarm-timers was inspired by the Android Alarm
driver (by Arve Hjønnevåg) found in the Android kernel tree.See: http://android.git.kernel.org/?p=kernel/common.git;a=blob;f=drivers/rtc/alarm.c;h=1250edfbdf3302f5e4ea6194847c6ef4bb7beb1c;hb=android-2.6.36
This in-kernel interface should be fairly compatible with the
Android alarm driver in-kernel interface, but has the advantage
of utilizing the new RTC timerqueue code instead of doing direct
RTC manipulation.CC: Arve Hjønnevåg
CC: Thomas Gleixner
CC: Alessandro Zummo
Acked-by: Arnd Bergmann
Signed-off-by: John Stultz