1. 25 6月, 2015 1 次提交
  2. 20 6月, 2015 1 次提交
  3. 17 4月, 2015 1 次提交
  4. 03 4月, 2015 1 次提交
  5. 24 1月, 2015 1 次提交
  6. 11 12月, 2014 2 次提交
  7. 09 8月, 2014 1 次提交
  8. 07 6月, 2014 1 次提交
  9. 04 4月, 2014 1 次提交
  10. 23 7月, 2013 1 次提交
    • Z
      rtc: Keep system awake until all expired RTC timers are handled · 14d0e347
      Zoran Markovic 提交于
      Current implementation of RTC interface allows for system suspend to
      occur in the following cases:
      (a) if a timer is set in the past and rtc_timer_do_work() is scheduled
      to handle it, and
      (b) if rtc_timer_do_work() is called to handle expired timers whose
      handlers implement a preemption point.
      
      A pending suspend request may be honoured in the above cases causing
      timer handling to be delayed until after the next resume. This is
      undesirable since timer handlers may have time-critical code to execute.
      
      This patch makes sure that the system stays awake until all expired
      timers are handled.
      
      Note that all calls to pm_stay_awake() are eventually paired with
      the single pm_relax() call in rtc_timer_do_work(), which is launched
      using schedule_work().
      
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Arve Hjonnevag <arve@android.com>
      Cc: Todd Poynor <toddpoynor@google.com>
      Signed-off-by: NZoran Markovic <zoran.markovic@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      14d0e347
  11. 04 7月, 2013 2 次提交
  12. 07 2月, 2013 1 次提交
  13. 09 8月, 2012 1 次提交
    • N
      RTC: Avoid races between RTC alarm wakeup and suspend. · 7523ceed
      NeilBrown 提交于
      If an RTC alarm fires just as suspend is happening, it is possible for
      suspend to complete and the alarm to be missed.
      
      To avoid the race, we must register the event with the PM core.
      
      As the event is made visible to userspace through a thread which is
      only scheduled by the interrupt, we need a pm_stay_awake/pm_relax
      pair preventing suspend from the interrupt until the thread completes
      its work.
      
      This makes the pm_wakeup_event() call in cmos_interrupt unnecessary as
      it provides suspend protection for all RTCs that use rtc_update_irq.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      7523ceed
  14. 16 3月, 2012 1 次提交
  15. 27 1月, 2012 3 次提交
    • R
      rtc: Disable the alarm in the hardware (v2) · 41c7f742
      Rabin Vincent 提交于
      Currently, the RTC code does not disable the alarm in the hardware.
      
      This means that after a sequence such as the one below (the files are in the
      RTC sysfs), the box will boot up after 2 minutes even though we've
      asked for the alarm to be turned off.
      
      	# echo $((`cat since_epoch`)+120) > wakealarm
      	# echo 0 > wakealarm
      	# poweroff
      
      Fix this by disabling the alarm when there are no timers to run.
      
      The original version of this patch was reverted. This version
      disables the irq directly instead of setting a disabled timer
      in the future.
      
      Cc: stable@kernel.org
      Cc: John Stultz <john.stultz@linaro.org>
      Signed-off-by: NRabin Vincent <rabin.vincent@stericsson.com>
      [Merged in the second revision from Rabin]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      41c7f742
    • N
      rtc: Expire alarms after the time is set. (v2) · 5f9679d2
      NeilBrown 提交于
      If the alarm time programming in the rtc is ever in the past, it won't fire,
      and any other alarm will be queued after it so they won't fire either.
      
      So any time that the alarm might be in the past, we need to trigger
      the irq handler to ensure the old alarm is cleared and the timer queue
      is fully in the future.
      
      This is done whenever the RTC clock is set.
      
      This is the second revision of this patch, which was earlier reverted.
      This version avoids the initialization problem, which is handled by
      a different patch.
      Tested-by: NSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      [Remove problematic initialization change, update commit log, also
      catch set_mmss case -jstultz]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      5f9679d2
    • J
      rtc: Avoid setting alarm to a time in the past · bd729d72
      John Stultz 提交于
      In some cases at boot up, the RTC alarm may be set in the past,
      but still have the enabled flag on. This was causing problems,
      because we would then enqueue the alarm into the timerqueue,
      but it would never fire. This would clog up the timerqueue
      and keep other alarms from working.
      
      The fix is to check the alarm against the current rtc time at
      boot and avoid enqueueing the alarm if it is in the past.
      Reported-by: NNeilBrown <neilb@suse.de>
      Tested-by: NNeilBrown <neilb@suse.de>
      Tested-by: NSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      bd729d72
  16. 11 1月, 2012 1 次提交
  17. 04 1月, 2012 2 次提交
    • L
      Revert "rtc: Expire alarms after the time is set." · f423fc62
      Linus Torvalds 提交于
      This reverts commit 93b2ec01.
      
      The call to "schedule_work()" in rtc_initialize_alarm() happens too
      early, and can cause oopses at bootup
      
      Neil Brown explains why we do it:
      
        "If you set an alarm in the future, then shutdown and boot again after
         that time, then you will end up with a timer_queue node which is in
         the past.
      
         When this happens the queue gets stuck.  That entry-in-the-past won't
         get removed until and interrupt happens and an interrupt won't happen
         because the RTC only triggers an interrupt when the alarm is "now".
      
         So you'll find that e.g.  "hwclock" will always tell you that
         'select' timed out.
      
         So we force the interrupt work to happen at the start just in case."
      
      and has a patch that convert it to do things in-process rather than with
      the worker thread, but right now it's too late to play around with this,
      so we just revert the patch that caused problems for now.
      Reported-by: NSander Eikelenboom <linux@eikelenboom.it>
      Requested-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Requested-by: NJohn Stultz <john.stultz@linaro.org>
      Cc: Neil Brown <neilb@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f423fc62
    • L
      Revert "rtc: Disable the alarm in the hardware" · 157e8bf8
      Linus Torvalds 提交于
      This reverts commit c0afabd3.
      
      It causes failures on Toshiba laptops - instead of disabling the alarm,
      it actually seems to enable it on the affected laptops, resulting in
      (for example) the laptop powering on automatically five minutes after
      shutdown.
      
      There's a patch for it that appears to work for at least some people,
      but it's too late to play around with this, so revert for now and try
      again in the next merge window.
      
      See for example
      
      	http://bugs.debian.org/652869
      
      Reported-and-bisected-by: Andreas Friedrich <afrie@gmx.net> (Toshiba Tecra)
      Reported-by: Antonio-M. Corbi Bellot <antonio.corbi@ua.es> (Toshiba Portege R500)
      Reported-by: Marco Santos <marco.santos@waynext.com> (Toshiba Portege Z830)
      Reported-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr>  (Toshiba Portege R830)
      Cc: Jonathan Nieder <jrnieder@gmail.com>
      Requested-by: NJohn Stultz <john.stultz@linaro.org>
      Cc: stable@kernel.org  # for the versions that applied this
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      157e8bf8
  18. 14 12月, 2011 1 次提交
    • N
      rtc: Expire alarms after the time is set. · 93b2ec01
      NeilBrown 提交于
      If the alarm time programming in the rtc is ever in the past, it won't fire,
      and any other alarm will be queued after it so they won't fire either.
      
      So any time that the alarm might be in the past, we need to trigger
      the irq handler to ensure the old alarm is cleared and the timer queue
      is fully in the future.
      
      This can happen:
       - when we first initialise the alarm
       - when we set the time in the rtc.
      
      so follow both of these by scheduling the timer work function.
      
      CC: stable@kernel.org
      Signed-off-by: NNeilBrown <neilb@suse.de>
      [Also catch set_mmss case -jstultz]
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      93b2ec01
  19. 23 11月, 2011 1 次提交
    • R
      rtc: Disable the alarm in the hardware · c0afabd3
      Rabin Vincent 提交于
      Currently, the RTC code does not disable the alarm in the hardware.
      
      This means that after a sequence such as the one below (the files are in the
      RTC sysfs), the box will boot up after 2 minutes even though we've
      asked for the alarm to be turned off.
      
      	# echo $((`cat since_epoch`)+120) > wakealarm
      	# echo 0 > wakealarm
      	# poweroff
      
      Fix this by disabling the alarm when there are no timers to run.
      
      Cc: stable@kernel.org
      Cc: John Stultz <john.stultz@linaro.org>
      Signed-off-by: NRabin Vincent <rabin.vincent@stericsson.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      c0afabd3
  20. 01 11月, 2011 1 次提交
  21. 11 8月, 2011 1 次提交
    • J
      rtc: Fix RTC PIE frequency limit · 938f97bc
      John Stultz 提交于
      Thomas earlier submitted a fix to limit the RTC PIE freq, but
      picked 5000Hz out of the air. Willy noticed that we should
      instead use the 8192Hz max from the rtc man documentation.
      
      Cc: Willy Tarreau <w@1wt.eu>
      Cc: stable@kernel.org
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      938f97bc
  22. 27 7月, 2011 6 次提交
  23. 02 6月, 2011 1 次提交
  24. 31 3月, 2011 1 次提交
  25. 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
  26. 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
  27. 18 2月, 2011 2 次提交
  28. 04 2月, 2011 1 次提交
  29. 22 1月, 2011 1 次提交