1. 25 6月, 2013 3 次提交
    • T
    • M
      clocksource: Add generic dummy timer driver · 06470651
      Mark Rutland 提交于
      Several architectures have a dummy timer driver tightly coupled with
      their broadcast code to support machines without cpu-local timers (or
      where there is a lack of driver support).
      
      Since 12ad1000: "clockevents: Add generic timer broadcast function"
      it's been possible to write broadcast-capable timer drivers decoupled
      from the broadcast mechanism. We can use this functionality to implement
      a generic dummy timer driver that can be shared by all architectures
      with generic tick broadcast (ARCH_HAS_TICK_BROADCAST).
      
      This patch implements a generic dummy timer using this facility.
      
      [sboyd: Make percpu data static, use __this_cpu_ptr(), move to
              early_initcall to properly register on each CPU, only
      	register if more than one CPU possible]
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: Marc Zyngier <marc.zyngier@arm.com>,
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lkml.kernel.org/r/1370291642-13259-3-git-send-email-sboyd@codeaurora.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      06470651
    • S
      clockevents: Prefer CPU local devices over global devices · 70e5975d
      Stephen Boyd 提交于
      On an SMP system with only one global clockevent and a dummy
      clockevent per CPU we run into problems. We want the dummy
      clockevents to be registered as the per CPU tick devices, but
      we can only achieve that if we register the dummy clockevents
      before the global clockevent or if we artificially inflate the
      rating of the dummy clockevents to be higher than the rating
      of the global clockevent. Failure to do so leads to boot
      hangs when the dummy timers are registered on all other CPUs
      besides the CPU that accepted the global clockevent as its tick
      device and there is no broadcast timer to poke the dummy
      devices.
      
      If we're registering multiple clockevents and one clockevent is
      global and the other is local to a particular CPU we should
      choose to use the local clockevent regardless of the rating of
      the device. This way, if the clockevent is a dummy it will take
      the tick device duty as long as there isn't a higher rated tick
      device and any global clockevent will be bumped out into
      broadcast mode, fixing the problem described above.
      Reported-and-tested-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Tested-by: soren.brinkmann@xilinx.com
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: John Stultz <john.stultz@linaro.org>
      Link: http://lkml.kernel.org/r/20130613183950.GA32061@codeaurora.orgSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      70e5975d
  2. 22 6月, 2013 1 次提交
    • S
      sched_clock: Add temporary asm/sched_clock.h · 629a6a2b
      Stephen Boyd 提交于
      Some new users of the ARM sched_clock framework are going through
      the arm-soc tree. Before 38ff87f7 (sched_clock: Make ARM's
      sched_clock generic for all architectures, 2013-06-01) the header
      file was in asm, but now it's in linux. One solution would be to
      do an evil merge of the arm-soc tree and fix up the asm users,
      but it's easier to add a temporary asm header that we can remove
      along with the few stragglers after the merge window is over.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      629a6a2b
  3. 19 6月, 2013 1 次提交
  4. 18 6月, 2013 1 次提交
    • S
      ARM: sched_clock: Load cycle count after epoch stabilizes · 336ae118
      Stephen Boyd 提交于
      There is a small race between when the cycle count is read from
      the hardware and when the epoch stabilizes. Consider this
      scenario:
      
       CPU0                           CPU1
       ----                           ----
       cyc = read_sched_clock()
       cyc_to_sched_clock()
                                       update_sched_clock()
                                        ...
                                        cd.epoch_cyc = cyc;
        epoch_cyc = cd.epoch_cyc;
        ...
        epoch_ns + cyc_to_ns((cyc - epoch_cyc)
      
      The cyc on cpu0 was read before the epoch changed. But we
      calculate the nanoseconds based on the new epoch by subtracting
      the new epoch from the old cycle count. Since epoch is most likely
      larger than the old cycle count we calculate a large number that
      will be converted to nanoseconds and added to epoch_ns, causing
      time to jump forward too much.
      
      Fix this problem by reading the hardware after the epoch has
      stabilized.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      336ae118
  5. 13 6月, 2013 4 次提交
  6. 09 6月, 2013 1 次提交
  7. 06 6月, 2013 3 次提交
  8. 30 5月, 2013 4 次提交
    • J
      x86: Fix vrtc_get_time/set_mmss to use new timespec interface · ce0b0989
      John Stultz 提交于
      The patch "x86: Increase precision of x86_platform.get/set_wallclock"
      changed the x86 platform set_wallclock/get_wallclock interfaces to
      use nsec granular timespecs instead of a second granular interface.
      
      However, that patch missed converting the vrtc code, so this patch
      converts those functions to use timespecs.
      
      Many thanks to the kbuild test robot for finding this!
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      ce0b0989
    • C
      power: Add option to log time spent in suspend · 5c83545f
      Colin Cross 提交于
      Below is a patch from android kernel that maintains a histogram of
      suspend times. Please review and provide feedback.
      
      Statistices on the time spent in suspend are kept in
      /sys/kernel/debug/sleep_time.
      
      Cc: Android Kernel Team <kernel-team@android.com>
      Cc: Colin Cross <ccross@android.com>
      Cc: Todd Poynor <toddpoynor@google.com>
      Cc: San Mehat <san@google.com>
      Cc: Benoit Goby <benoit@android.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NColin Cross <ccross@android.com>
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      [zoran.markovic@linaro.org: Re-formatted suspend time table to better
      fit expected values. Moved accounting of suspend time into timekeeping
      core. Removed CONFIG_SUSPEND_TIME flag and made the feature conditional
      on CONFIG_DEBUG_FS. Changed the file name to sleep_time to better fit
      terminology in timekeeping core. Changed seq_printf to seq_puts. Tweaked
      commit message]
      Signed-off-by: NZoran Markovic <zoran.markovic@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      5c83545f
    • T
      timerfd: Add alarm timers · 11ffa9d6
      Todd Poynor 提交于
      Add support for clocks CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM,
      thereby enabling wakeup alarm timers via file descriptors.
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      11ffa9d6
    • T
      alarmtimer: Add functions for timerfd support · 6cffe00f
      Todd Poynor 提交于
      Add functions needed for hooking up alarmtimer to timerfd:
      
      * alarm_restart: Similar to hrtimer_restart, restart an alarmtimer after
        the expires time has already been updated (as with alarm_forward).
      
      * alarm_forward_now: Similar to hrtimer_forward_now, move the expires
        time forward to an interval from the current time of the associated clock.
      
      * alarm_start_relative: Start an alarmtimer with an expires time relative to
        the current time of the associated clock.
      
      * alarm_expires_remaining: Similar to hrtimer_expires_remaining, return the
        amount of time remaining until alarm expiry.
      Signed-off-by: NTodd Poynor <toddpoynor@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      6cffe00f
  9. 29 5月, 2013 5 次提交
  10. 28 5月, 2013 2 次提交
  11. 16 5月, 2013 15 次提交