Skip to content

RFC A posix clock/timer interface to the RTC

John Stultz lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6posix clocks: dynamic clock ids.include/linux/posix-timers.h include/linux/time.h kernel/posix-timers.c+42 -83 replies
2/6Introduce timerlist infrastructure.include/linux/timerlist.h lib/Makefile lib/timerlist.c+153 -10 replies
3/6hrtimers: Convert hrtimers to use timerlist infrastructureinclude/linux/hrtimer.h kernel/hrtimer.c kernel/time/timer_list.c+49 -770 replies
4/6RTC: Rework RTC code to use timerlist for eventsdrivers/rtc/class.c drivers/rtc/interface.c drivers/rtc/rtc-lib.c +1 more+309 -2292 replies
5/6RTC: Remove UIE emulationdrivers/rtc/rtc-dev.c include/linux/rtc.h+0 -1160 replies
6/6RTC: Add posix clock/timer interfacedrivers/rtc/Makefile drivers/rtc/class.c drivers/rtc/posix.c +3 more+292 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] [RFC] A posix clock/timer interface to the RTC

From: John Stultz <[email protected]>

This patchset allows the RTC to be managed via the posix_clocks/timers interface. This allows applications to program timer events that will wake the system from suspend state. If the system is not suspended, the timers fire like normal posix timers.

Currently, if an application wants to trigger a RTC alarm to wake up from suspend, they must use the sysfs wakealarm interface or the rtc chardev RTC_WKALM_SET ioctl. The limitation with this interface is that it is fairly hardware oriented, so multiple applications cannot set an RTC alarm without overwriting any previous alarms set by other applications.

The in-kernel posix interface allows for the kernel to manage a list of timers that control when the alarm is fired, so applications do not need to coordinate access to the alarm hardware.

My earlier proof-of-concept hack/patch for this work (see
http://lwn.net/Articles/405986/ ) did not get much review from the RTC folks, so I've carried on reworking a number of layers of code in order to make this functionality something that could possibly be upstreamed in the future.

The patches are still fairly rough, but together they do function, so while there is still work to be done, I wanted to send this out again so folks had an idea of the scope of the work and could make suggestions as to where I've gone wrong. :)

So please let me know what you think.

thanks
-john

CC Alessandro Zummo <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Richard Cochran <[email protected]>

John Stultz (5):
[RFC] Introduce timerlist infrastructure.
[RFC] hrtimers: Convert hrtimers to use timerlist infrastructure [RFC] RTC: Rework RTC code to use timerlist for events [RFC] RTC: Remove UIE emulation
[RFC] RTC: Add posix clock/timer interface

Richard Cochran (1):
[RFC] posix clocks: dynamic clock ids.

 drivers/rtc/Makefile         |    2 +-
 drivers/rtc/class.c          |   23 ++
 drivers/rtc/interface.c      |  453 +++++++++++++++++++++---------------------
 drivers/rtc/posix.c          |  274 +++++++++++++++++++++++++
 drivers/rtc/rtc-dev.c        |  104 ----------
 drivers/rtc/rtc-lib.c        |   26 +++
 drivers/rtc/rtc-sysfs.c      |   10 +
 include/linux/hrtimer.h      |   32 ++--
 include/linux/posix-timers.h |    9 +-
 include/linux/rtc.h          |   49 +++--
 include/linux/time.h         |    2 +
 include/linux/timerlist.h    |   37 ++++
 kernel/hrtimer.c             |   86 +++-----
 kernel/posix-timers.c        |   41 +++-
 kernel/time/timer_list.c     |    8 +-
 lib/Makefile                 |    2 +-
 lib/timerlist.c              |  115 +++++++++++
 17 files changed, 843 insertions(+), 430 deletions(-)
 create mode 100644 drivers/rtc/posix.c
 create mode 100644 include/linux/timerlist.h
 create mode 100644 lib/timerlist.c