1. 02 6月, 2011 1 次提交
  2. 31 3月, 2011 1 次提交
  3. 30 3月, 2011 1 次提交
    • J
      RTC: Fix early irqs caused by calling rtc_set_alarm too early · f6d5b331
      John Stultz 提交于
      When we register an rtc device at boot, we read the alarm value
      in hardware and set the rtc device's aie_timer to that value.
      
      The initial method to do this was to simply call rtc_set_alarm()
      with the value read from hardware. However, this may cause problems
      as rtc_set_alarm may enable interupts, and the RTC alarm might fire,
      which can cause invalid pointer dereferencing since the RTC registration
      is not complete.
      
      This patch solves the issue by initializing the rtc_device.aie_timer
      y hand via rtc_initialize_alarm(). This avoids any calls to the RTC
      hardware which might enable interrupts too early.
      
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      Reported-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Tested-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      f6d5b331
  4. 10 3月, 2011 1 次提交
    • J
      RTC: Initialize kernel state from RTC · f44f7f96
      John Stultz 提交于
      Mark Brown pointed out a corner case: that RTC alarms should
      be allowed to be persistent across reboots if the hardware
      supported it.
      
      The rework of the generic layer to virtualize the RTC alarm
      virtualized much of the alarm handling, and removed the
      code used to read the alarm time from the hardware.
      
      Mark noted if we want the alarm to be persistent across
      reboots, we need to re-read the alarm value into the
      virtualized generic layer at boot up, so that the generic
      layer properly exposes that value.
      
      This patch restores much of the earlier removed
      rtc_read_alarm code and wires it in so that we
      set the kernel's alarm value to what we find in the
      hardware at boot time.
      
      NOTE: Not all hardware supports persistent RTC alarm state across
      system reset. rtc-cmos for example will keep the alarm time, but
      disables the AIE mode irq. Applications should not expect the RTC
      alarm to be valid after a system reset. We will preserve what
      we can, to represent the hardware state at boot, but its not
      guarenteed.
      
      Further, in the future, with multiplexed RTC alarms, the
      soonest alarm to fire may not be the one set via the /dev/rt
      ioctls. So an application may set the alarm with RTC_ALM_SET,
      but after a reset find that RTC_ALM_READ returns an earlier
      time. Again, we preserve what we can, but applications should
      not expect the RTC alarm state to persist across a system reset.
      
      Big thanks to Mark for pointing out the issue!
      Thanks also to Marcelo for helping think through the solution.
      
      CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
      CC: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      CC: rtc-linux@googlegroups.com
      Reported-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      f44f7f96
  5. 18 2月, 2011 2 次提交
  6. 04 2月, 2011 1 次提交
  7. 22 1月, 2011 2 次提交
  8. 14 12月, 2010 1 次提交
  9. 11 12月, 2010 1 次提交
    • J
      RTC: Rework RTC code to use timerqueue for events · 6610e089
      John Stultz 提交于
      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: NJohn Stultz <john.stultz@linaro.org>
      LKML Reference: <1290136329-18291-4-git-send-email-john.stultz@linaro.org>
      Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      CC: Alessandro Zummo <a.zummo@towertech.it>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Richard Cochran <richardcochran@gmail.com>
      6610e089
  10. 12 10月, 2009 1 次提交
  11. 20 6月, 2009 1 次提交
  12. 07 1月, 2009 3 次提交
  13. 05 1月, 2009 1 次提交
  14. 07 11月, 2008 1 次提交
  15. 31 7月, 2008 1 次提交
  16. 22 7月, 2008 1 次提交
  17. 05 7月, 2008 1 次提交
    • D
      rtc: rtc_read_alarm() handles wraparound · a01cc657
      David Brownell 提交于
      While 0e36a9a4 ("rtc: fix readback from
      /sys/class/rtc/rtc?/wakealarm") made sure that active alarms were never
      returned with invalid "wildcard" fields (negative), it can still report
      (wrongly) that the alarm triggers in the past.
      
      Example, if it's now 10am, an alarm firing at 5am will be triggered
      TOMORROW not today.  (Which may also be next month or next year...)
      
      This updates that alarm handling in three ways:
      
        * Handle alarm rollover in the common cases of RTCs that don't
          support matching on all date fields.
      
        * Skip the invalid-field logic when it's not needed.
      
        * Minor bugfix ... tm_isdst should be ignored, it's one of the
          fields Linux doesn't maintain.
      
      A warning is emitted for some of the unhandled rollover cases, but the
      possible combinations are a bit too numerous to handle every bit of
      potential hardware and firmware braindamage.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Mark Lord <lkml@rtr.ca>
      Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a01cc657
  18. 25 1月, 2008 1 次提交
  19. 06 12月, 2007 1 次提交
  20. 30 11月, 2007 1 次提交
  21. 17 10月, 2007 3 次提交
  22. 09 5月, 2007 3 次提交
  23. 02 3月, 2007 1 次提交
  24. 26 11月, 2006 2 次提交
  25. 26 6月, 2006 1 次提交
  26. 28 3月, 2006 1 次提交