1. 11 1月, 2012 10 次提交
  2. 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
  3. 28 12月, 2011 3 次提交
  4. 23 12月, 2011 1 次提交
  5. 14 12月, 2011 2 次提交
    • J
      rtc: m41t80: Workaround broken alarm functionality · c3b79770
      John Stultz 提交于
      The m41t80 driver can read and set the alarm, but it doesn't
      seem to have a functional alarm irq.
      
      This causes failures when the generic core sees alarm functions,
      but then cannot use them properly for things like UIE mode.
      
      Disabling the alarm functions allows proper error reporting,
      and possible fallback to emulated modes. Once someone fixes
      the alarm irq functionality, this can be restored.
      
      CC: stable@kernel.org
      CC: Matt Turner <mattst88@gmail.com>
      CC: Nico Macrionitis <acrux@cruxppc.org>
      CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
      Reported-by: NMatt Turner <mattst88@gmail.com>
      Reported-by: NNico Macrionitis <acrux@cruxppc.org>
      Tested-by: NNico Macrionitis <acrux@cruxppc.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      c3b79770
    • 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
  6. 09 12月, 2011 1 次提交
  7. 28 11月, 2011 1 次提交
  8. 23 11月, 2011 2 次提交
    • A
      rtc: Fix some bugs that allowed accumulating time drift in suspend/resume · 6a8943d9
      Arve Hjønnevåg 提交于
      The current code checks if abs(delta_delta.tv_sec) is greater or
      equal to two before it discards the old delta value, but this can
      trigger at close to -1 seconds since -1.000000001 seconds is stored
      as tv_sec -2 and tv_nsec 999999999 in a normalized timespec.
      
      rtc_resume had an early return check if the rtc value had not changed
      since rtc_suspend. This effectivly stops time for the duration of the
      short sleep. Check if sleep_time is positive after all the adjustments
      have been applied instead since this allows the old_system adjustment
      in rtc_suspend to have an effect even for short sleep cycles.
      
      CC: stable@kernel.org
      Signed-off-by: NArve Hjønnevåg <arve@android.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      6a8943d9
    • 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
  9. 22 11月, 2011 2 次提交
  10. 15 11月, 2011 1 次提交
  11. 12 11月, 2011 1 次提交
    • F
      vrtc: change its year offset from 1960 to 1972 · 57e6319d
      Feng Tang 提交于
      Real world year equals the value in vrtc YEAR register plus an offset.
      We used 1960 as the offset to make leap year consistent, but for a
      device's first use, its YEAR register is 0 and the system year will
      be parsed as 1960 which is not a valid UNIX time and will cause many
      applications to fail mysteriously. So we use 1972 instead to fix this
      issue.
      
      Updated patch which adds a sanity check suggested by Mathias
      
      This isn't a change in behaviour for systems, because 1972 is the one we
      actually use. It's the old version in upstream which is out of sync with
      all devices.
      Signed-off-by: NFeng Tang <feng.tang@intel.com>
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57e6319d
  12. 03 11月, 2011 3 次提交
  13. 02 11月, 2011 1 次提交
  14. 01 11月, 2011 1 次提交
  15. 15 9月, 2011 2 次提交
  16. 27 8月, 2011 2 次提交
    • T
      rtc: twl: Fix registration vs. init order · 7e72c686
      Todd Poynor 提交于
      Only register as an RTC device after the hardware has been
      successfully initialized.  The RTC class driver will call
      back to this driver to read a pending alarm, and other
      drivers watching for new devices on the RTC class may
      read the RTC time upon registration.  Such access might
      occur while the RTC is stopped, prior to clearing
      pending alarms, etc.
      
      The new ordering also avoids leaving the platform
      device drvdata set to an unregistered struct rtc_device *
      on probe errors.
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      7e72c686
    • M
      rtc: Initialized rtc_time->tm_isdst · a7402deb
      Mike Waychison 提交于
      Even though the Linux kernel does not use the tm_isdst field, it is
      exposed as part of the ABI.  This field can accidentally be left
      initialized, which is why we currently memset buffers returned to
      userland in rtc_read_time.
      
      There is a case however where the field can return garbage from the
      stack though when using the RTC_ALM_READ ioctl on the rtc device.  This
      ioctl invokes rtc_read_alarm, which is careful to memset the rtc_wkalrm
      buffer that is copied to userland, but it then uses a struct copy to
      assign to alarm->time given the return value from rtc_ktime_to_tm().
      
      rtc_ktime_to_tm() is implemented by calling rtc_time_to_tm using a
      derivative seconds counds from ktime, but rtc_time_to_tm does not assign
      a value to ->tm_isdst.  This results in garbage from rtc_ktime_to_tm()'s
      frame ending up being copied out to userland as part of the returned
      rtc_wkalrm.
      
      Fix this by initializing rtc_time->tm_isdst to 0 in rtc_time_to_tm.
      Signed-off-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      a7402deb
  17. 26 8月, 2011 2 次提交
  18. 11 8月, 2011 3 次提交