1. 24 3月, 2012 1 次提交
  2. 06 3月, 2012 1 次提交
  3. 14 2月, 2012 1 次提交
  4. 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
  5. 20 1月, 2012 2 次提交
    • R
      Revert "RTC: sa1100: remove redundant code of setting alarm" · 57270fcd
      Russell King 提交于
      This reverts commit 42874759.
      
      This wasn't tested as a stand-alone patch, and it has build errors
      without the following patches applied:
      
      drivers/rtc/rtc-sa1100.c: In function 'sa1100_rtc_set_alarm':
      drivers/rtc/rtc-sa1100.c:208: error: 'now' undeclared (first use in this function)
      drivers/rtc/rtc-sa1100.c:208: error: (Each undeclared identifier is reported only once
      drivers/rtc/rtc-sa1100.c:208: error: for each function it appears in.)
      drivers/rtc/rtc-sa1100.c:210: error: incompatible type for argument 3 of 'rtc_next_alarm_time'
      drivers/rtc/rtc-sa1100.c:211: error: 'time' undeclared (first use in this function)
      
      So it too gets reverted to bring us back to a working point.
      57270fcd
    • R
      Revert "RTC: sa1100: support sa1100, pxa and mmp soc families" · a0164a57
      Russell King 提交于
      This reverts commit 7cea0065.
      
      The sa1100 cleanups fatally broke the SA1100 RTC driver - the first
      hint that something is wrong are these compiler warnings:
      
      drivers/rtc/rtc-sa1100.c:42:1: warning: "RCNR" redefined
      In file included from arch/arm/mach-sa1100/include/mach/hardware.h:73,
                       from drivers/rtc/rtc-sa1100.c:35:
      arch/arm/mach-sa1100/include/mach/SA-1100.h:877:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:43:1: warning: "RTAR" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:876:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:44:1: warning: "RTSR" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:879:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:45:1: warning: "RTTR" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:878:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:47:1: warning: "RTSR_HZE" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:891:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:48:1: warning: "RTSR_ALE" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:890:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:49:1: warning: "RTSR_HZ" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:889:1: warning: this is the location of the previous definition
      drivers/rtc/rtc-sa1100.c:50:1: warning: "RTSR_AL" redefined
      arch/arm/mach-sa1100/include/mach/SA-1100.h:888:1: warning: this is the location of the previous definition
      
      and the second problem, which is far more severe, are the different
      register layouts, resulting in the wrong registers being read on
      SA11x0 platforms.  This patch adds:
      
      	#define RCNR           0x00    /* RTC Count Register */
      	#define RTAR           0x04    /* RTC Alarm Register */
      	#define RTSR           0x08    /* RTC Status Register */
      	#define RTTR           0x0c    /* RTC Timer Trim Register */
      
      but the SA11x0 registers are:
      
      	#define RTAR            __REG(0x90010000)  /* RTC Alarm Reg. */
      	#define RCNR            __REG(0x90010004)  /* RTC CouNt Reg. */
      	#define RTTR            __REG(0x90010008)  /* RTC Trim Reg. */
      	#define RTSR            __REG(0x90010010)  /* RTC Status Reg. */
      a0164a57
  6. 11 1月, 2012 15 次提交
  7. 10 1月, 2012 3 次提交
    • G
      rtc-puv3: solve section mismatch in rtc-puv3.c · b3a0aa3a
      Guan Xuetao 提交于
      The patch renames puv3_rtcdrv to puv3_rtc_driver, so that modpost will know
      that this is simply a list of pointers to driver functions, in which case
      the section mismatch is OK. (Thanks Michal Marek)
      
      Cc: Axel Lin <axel.lin@gmail.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: rtc-linux@googlegroups.com
      Signed-off-by: NGuan Xuetao <gxt@mprc.pku.edu.cn>
      
      --
      Section mismatch warning information:
      
      WARNING: drivers/rtc/built-in.o(.data+0x90): Section mismatch in
      reference from the variable puv3_rtcdrv to the
      function .devinit.text:puv3_rtc_probe()
      The variable puv3_rtcdrv references
      the function __devinit puv3_rtc_probe()
      If the reference is valid then annotate the
      variable with __init* or __refdata (see linux/init.h) or name the
      variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      
      WARNING: drivers/rtc/built-in.o(.data+0x94): Section mismatch in
      reference from the variable puv3_rtcdrv to the
      function .devexit.text:puv3_rtc_remove()
      The variable puv3_rtcdrv references
      the function __devexit puv3_rtc_remove()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      
      WARNING: drivers/built-in.o(.data+0x6c04): Section mismatch in reference
      from the variable puv3_rtcdrv to the
      function .devinit.text:puv3_rtc_probe()
      The variable puv3_rtcdrv references
      the function __devinit puv3_rtc_probe()
      If the reference is valid then annotate the
      variable with __init* or __refdata (see linux/init.h) or name the
      variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      
      WARNING: drivers/built-in.o(.data+0x6c08): Section mismatch in reference
      from the variable puv3_rtcdrv to the
      function .devexit.text:puv3_rtc_remove()
      The variable puv3_rtcdrv references
      the function __devexit puv3_rtc_remove()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      
      WARNING: vmlinux.o(.data+0x1126c): Section mismatch in reference from
      the variable puv3_rtcdrv to the function .devinit.text:puv3_rtc_probe()
      The variable puv3_rtcdrv references
      the function __devinit puv3_rtc_probe()
      If the reference is valid then annotate the
      variable with __init* or __refdata (see linux/init.h) or name the
      variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      
      WARNING: vmlinux.o(.data+0x11270): Section mismatch in reference from
      the variable puv3_rtcdrv to the function .devexit.text:puv3_rtc_remove()
      The variable puv3_rtcdrv references
      the function __devexit puv3_rtc_remove()
      If the reference is valid then annotate the
      variable with __exit* (see linux/init.h) or name the variable:
      *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
      *_console
      b3a0aa3a
    • G
      rtc-puv3: using module_platform_driver() · 60e2b00e
      Guan Xuetao 提交于
      This patch converts the driver to use the module_platform_driver()
      macro which makes the code smaller and a bit simpler.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Signed-off-by: NGuan Xuetao <gxt@mprc.pku.edu.cn>
      60e2b00e
    • G
      rtc-puv3: irq: remove IRQF_DISABLED · a9196b0b
      Guan Xuetao 提交于
      This flag is deprecated, so is removed now.
      Signed-off-by: NYong Zhang <yong.zhang@gmail.com>
      Signed-off-by: NGuan Xuetao <gxt@mprc.pku.edu.cn>
      a9196b0b
  8. 09 1月, 2012 2 次提交
  9. 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
  10. 28 12月, 2011 3 次提交
  11. 23 12月, 2011 1 次提交
  12. 18 12月, 2011 1 次提交
  13. 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
  14. 09 12月, 2011 1 次提交
  15. 28 11月, 2011 1 次提交
  16. 23 11月, 2011 1 次提交
    • 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