Skip to content
  1. Dec 11, 2010
    • John Stultz's avatar
      RTC: Rework RTC code to use timerqueue for events · 6610e089
      John Stultz authored
      
      
      This patch reworks a large portion of the generic RTC code
      to in-effect virtualize the rtc interrupt code.
      
      The current RTC interface is very much a raw hardware interface.
      Via the proc, /dev/, or sysfs interfaces, applciations can set
      the hardware to trigger interrupts in one of three modes:
      
      AIE: Alarm interrupt
      UIE: Update interrupt (ie: once per second)
      PIE: Periodic interrupt (sub-second irqs)
      
      The problem with this interface is that it limits the RTC hardware
      so it can only be used by one application at a time.
      
      The purpose of this patch is to extend the RTC code so that we can
      multiplex multiple applications event needs onto a single RTC device.
      This is done by utilizing the timerqueue infrastructure to manage
      a list of events, which cause the RTC hardware to be programmed
      to fire an interrupt for the next event in the list.
      
      In order to preserve the functionality of the exsting proc,/dev/ and
      sysfs interfaces, we emulate the different interrupt modes as follows:
      
      AIE: We create a rtc_timer dedicated to AIE mode interrupts. There is
      only one per device, so we don't change existing interface semantics.
      
      UIE: Again, a dedicated rtc_timer, set for periodic mode, is used
      to emulate UIE interrupts. Again, only one per device.
      
      PIE: Since PIE mode interrupts fire faster then the RTC's clock read
      granularity, we emulate PIE mode interrupts using a hrtimer. Again,
      one per device.
      
      With this patch, the rtctest.c application in Documentation/rtc.txt
      passes fine on x86 hardware. However, there may very well still be
      bugs, so greatly I'd appreciate any feedback or testing!
      
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      LKML Reference: <1290136329-18291-4-git-send-email-john.stultz@linaro.org>
      Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Richard Cochran <richardcochran@gmail.com>
      6610e089
    • John Stultz's avatar
      hrtimer: fix timerqueue conversion flub · b007c389
      John Stultz authored
      
      
      In converting the hrtimers to timerqueue, I missed
      a spot in hrtimer_run_queues where we loop running
      timers. We end up not pulling the new next value out
      and instead just use the last next value, causing
      boot time hangs in some cases.
      
      The proper fix is to pull timerqueue_getnext each iteration
      instead of using a local next value.
      
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      b007c389
    • John Stultz's avatar
      hrtimers: Convert hrtimers to use timerlist infrastructure · 998adc3d
      John Stultz authored
      
      
      Converts the hrtimer code to use the new timerlist infrastructure
      
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      LKML Reference: <1290136329-18291-3-git-send-email-john.stultz@linaro.org>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Richard Cochran <richardcochran@gmail.com>
      998adc3d
    • John Stultz's avatar
      timers: Fixup allmodconfig build issue · 9bb99b14
      John Stultz authored
      
      
      Adds missed EXPORT_SYMBOL lines that cause the following build
      failures with allmodconfig:
      ERROR: "timerqueue_add" [drivers/rtc/rtc-core.ko] undefined!
      ERROR: "timerqueue_getnext" [drivers/rtc/rtc-core.ko] undefined!
      ERROR: "timerqueue_del" [drivers/rtc/rtc-core.ko] undefined!
      
      Reported-by: default avatarIngo Molnar <mingo@elte.hu>
      Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      9bb99b14
    • John Stultz's avatar
      timers: Rename timerlist infrastructure to timerqueue · 1f5a2479
      John Stultz authored
      
      
      Thomas pointed out a namespace collision between the new timerlist
      infrastructure I introduced and the existing timer_list.c
      
      So to avoid confusion, I've renamed the timerlist infrastructure
      to timerqueue.
      
      Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      1f5a2479
  2. Dec 03, 2010
    • John Stultz's avatar
      timers: Introduce timerlist infrastructure. · 87de5ac7
      John Stultz authored
      
      
      The timerlist infrastructure is a thin layer over the rbtree
      code that implements a simple list of timers sorted by an
      expires value, and a getnext function that provides a pointer
      to the earliest timer.
      
      This infrastructure allows drivers and other kernel infrastructure
      to easily implement timers without duplicating code.
      
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      LKML Reference: <1290136329-18291-2-git-send-email-john.stultz@linaro.org>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Richard Cochran <richardcochran@gmail.com>
      87de5ac7
  3. Nov 10, 2010
  4. Oct 22, 2010
  5. Oct 21, 2010
  6. Sep 10, 2010
  7. Sep 08, 2010