23 Oct, 2015

1 commit

  • commit 2619d7e9c92d524cb155ec89fd72875321512e5b upstream.

    The internal clocksteering done for fine-grained error
    correction uses a logarithmic approximation, so any time
    adjtimex() adjusts the clock steering, timekeeping_freqadjust()
    quickly approximates the correct clock frequency over a series
    of ticks.

    Unfortunately, the logic in timekeeping_freqadjust(), introduced
    in commit:

    dc491596f639 ("timekeeping: Rework frequency adjustments to work better w/ nohz")

    used the abs() function with a s64 error value to calculate the
    size of the approximated adjustment to be made.

    Per include/linux/kernel.h:

    "abs() should not be used for 64-bit types (s64, u64, long long) - use abs64()".

    Thus on 32-bit platforms, this resulted in the clocksteering to
    take a quite dampended random walk trying to converge on the
    proper frequency, which caused the adjustments to be made much
    slower then intended (most easily observed when large
    adjustments are made).

    This patch fixes the issue by using abs64() instead.

    Reported-by: Nuno Gonçalves
    Tested-by: Nuno Goncalves
    Signed-off-by: John Stultz
    Cc: Linus Torvalds
    Cc: Miroslav Lichvar
    Cc: Peter Zijlstra
    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1441840051-20244-1-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    John Stultz
     

13 May, 2015

1 commit

  • It was noted that the 32bit implementation of ktime_divns()
    was doing unsigned division and didn't properly handle
    negative values.

    And when a ktime helper was changed to utilize
    ktime_divns, it caused a regression on some IR blasters.
    See the following bugzilla for details:
    https://bugzilla.redhat.com/show_bug.cgi?id=1200353

    This patch fixes the problem in ktime_divns by checking
    and preserving the sign bit, and then reapplying it if
    appropriate after the division, it also changes the return
    type to a s64 to make it more obvious this is expected.

    Nicolas also pointed out that negative dividers would
    cause infinite loops on 32bit systems, negative dividers
    is unlikely for users of this function, but out of caution
    this patch adds checks for negative dividers for both
    32-bit (BUG_ON) and 64-bit(WARN_ON) versions to make sure
    no such use cases creep in.

    [ tglx: Hand an u64 to do_div() to avoid the compiler warning ]

    Fixes: 166afb64511e 'ktime: Sanitize ktime_to_us/ms conversion'
    Reported-and-tested-by: Trevor Cordes
    Signed-off-by: John Stultz
    Acked-by: Nicolas Pitre
    Cc: Ingo Molnar
    Cc: Josh Boyer
    Cc: One Thousand Gnomes
    Cc:
    Link: http://lkml.kernel.org/r/1431118043-23452-1-git-send-email-john.stultz@linaro.org
    Signed-off-by: Thomas Gleixner

    John Stultz
     

10 May, 2015

1 commit


25 Apr, 2015

1 commit

  • A clockevent device is marked DETACHED when it is replaced by another
    clockevent device.

    The device is shutdown properly for drivers that implement legacy
    ->set_mode() callback, as we call ->set_mode() for CLOCK_EVT_MODE_UNUSED
    as well.

    But for the new per-state callback interface, we skip shutting down the
    device, as we thought its an internal state change. That wasn't correct.

    The effect is that the device is left programmed in oneshot or periodic
    mode.

    Fall-back to 'case CLOCK_EVT_STATE_SHUTDOWN', to shutdown the device.

    Fixes: bd624d75db21 "clockevents: Introduce mode specific callbacks"
    Reported-by: Daniel Lezcano
    Signed-off-by: Viresh Kumar
    Cc: linaro-kernel@lists.linaro.org
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/eef0a91c51b74d4e52c8e5a95eca27b5a0563f07.1428650683.git.viresh.kumar@linaro.org
    Signed-off-by: Thomas Gleixner

    Viresh Kumar
     

22 Apr, 2015

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here's the big char/misc driver patchset for 4.1-rc1.

    Lots of different driver subsystem updates here, nothing major, full
    details are in the shortlog.

    All of this has been in linux-next for a while"

    * tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (133 commits)
    mei: trace: remove unused TRACE_SYSTEM_STRING
    DTS: ARM: OMAP3-N900: Add lis3lv02d support
    Documentation: DT: lis302: update wakeup binding
    lis3lv02d: DT: add wakeup unit 2 and wakeup threshold
    lis3lv02d: DT: use s32 to support negative values
    Drivers: hv: hv_balloon: correctly handle num_pages>INT_MAX case
    Drivers: hv: hv_balloon: correctly handle val.freeram directory
    coresight-tmc: Adding a status interface to sysfs
    coresight: remove the unnecessary configuration coresight-default-sink
    ...

    Linus Torvalds
     

03 Apr, 2015

16 commits

  • Some braces in tick_freeze() are not necessary, so drop them.

    Signed-off-by: Rafael J. Wysocki
    Cc: peterz@infradead.org
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1534128.H5hN3KBFB4@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Rafael J. Wysocki
     
  • A recent conflict resolution has left tick_resume() in
    tick_unfreeze() which leads to an unbalanced execution of
    tick_resume_broadcast() every time that function runs.

    Fix that by replacing the tick_resume() in tick_unfreeze()
    with tick_resume_local() as appropriate.

    Signed-off-by: Rafael J. Wysocki
    Cc: boris.ostrovsky@oracle.com
    Cc: david.vrabel@citrix.com
    Cc: konrad.wilk@oracle.com
    Cc: peterz@infradead.org
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/8099075.V0LvN3pQAV@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Rafael J. Wysocki
     
  • Arch specific management of xtime/jiffies/wall_to_monotonic is
    gone for quite a while. Zap the stale comment.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Acked-by: John Stultz
    Cc: Peter Zijlstra
    Cc: John Stultz
    Link: http://lkml.kernel.org/r/2422730.dmO29q661S@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • clockevents_notify() is a leftover from the early design of the
    clockevents facility. It's really not a notification mechanism,
    it's a multiplex call. We are way better off to have explicit
    calls instead of this monstrosity.

    Split out the cleanup function for a dead cpu and invoke it
    directly from the cpu down code. Make it conditional on
    CPU_HOTPLUG as well.

    Temporary change, will be refined in the future.

    Signed-off-by: Thomas Gleixner
    [ Rebased, added clockevents_notify() removal ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1735025.raBZdQHM3m@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • clockevents_notify() is a leftover from the early design of the
    clockevents facility. It's really not a notification mechanism,
    it's a multiplex call. We are way better off to have explicit
    calls instead of this monstrosity.

    Split out the tick_handover call and invoke it explicitely from
    the hotplug code. Temporary solution will be cleaned up in later
    patches.

    Signed-off-by: Thomas Gleixner
    [ Rebase ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Cc: John Stultz
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Link: http://lkml.kernel.org/r/1658173.RkEEILFiQZ@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Now that all users are converted over to explicit calls into the
    clockevents state machine, remove the notification chain leftovers.

    Original-from: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Cc: John Stultz
    Link: http://lkml.kernel.org/r/14018863.NQUzkFuafr@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Rafael J. Wysocki
     
  • clockevents_notify() is a leftover from the early design of the
    clockevents facility. It's really not a notification mechanism,
    it's a multiplex call. We are way better off to have explicit
    calls instead of this monstrosity.

    Split out the broadcast oneshot control into a separate function
    and provide inline helpers. Switch clockevents_notify() over.
    This will go away once all callers are converted.

    This also gets rid of the nested locking of clockevents_lock and
    broadcast_lock. The broadcast oneshot control functions do not
    require clockevents_lock. Only the managing functions
    (setup/shutdown/suspend/resume of the broadcast device require
    clockevents_lock.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Alexandre Courbot
    Cc: Daniel Lezcano
    Cc: Len Brown
    Cc: Peter Zijlstra
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: Tony Lindgren
    Link: http://lkml.kernel.org/r/13000649.8qZuEDV0OA@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • All users converted. Remove the notify leftovers.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/2076318.76XJZ8QYP3@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • clockevents_notify() is a leftover from the early design of the
    clockevents facility. It's really not a notification mechanism,
    it's a multiplex call. We are way better off to have explicit
    calls instead of this monstrosity.

    Split out the broadcast control into a separate function and
    provide inline helpers. Switch clockevents_notify() over. This
    will go away once all callers are converted.

    This also gets rid of the nested locking of clockevents_lock and
    broadcast_lock. The broadcast control functions do not require
    clockevents_lock. Only the managing functions
    (setup/shutdown/suspend/resume of the broadcast device require
    clockevents_lock.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Daniel Lezcano
    Cc: Len Brown
    Cc: Peter Zijlstra
    Cc: Tony Lindgren
    Link: http://lkml.kernel.org/r/8086559.ttsuS0n1Xr@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Ingo noted that the description of clocks_calc_max_nsecs()'s
    50% safety margin was somewhat circular. So this patch tries
    to improve the comment to better explain what we mean by the
    50% safety margin and why we need it.

    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-20-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    John Stultz
     
  • If a system does not provide a persistent_clock(), the time
    will be updated on resume by rtc_resume(). With the addition
    of the non-stop clocksources for suspend timing, those systems
    set the time on resume in timekeeping_resume(), but may not
    provide a valid persistent_clock().

    This results in the rtc_resume() logic thinking no one has set
    the time and it then will over-write the suspend time again,
    which is not necessary and only increases clock error.

    So, fix this for rtc_resume().

    This patch also improves the name of persistent_clock_exist to
    make it more grammatical.

    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-19-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • When there's no persistent clock, normally
    timekeeping_suspend_time should always be zero, but this can
    break in timekeeping_suspend().

    At T1, there was a system suspend, so old_delta was assigned T1.
    After some time, one time adjustment happened, and xtime got the
    value of T1-dt(0s


    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-18-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • timekeeping_inject_sleeptime64() is only used by RTC
    suspend/resume, so add build dependencies on the necessary RTC
    related macros.

    Signed-off-by: Xunlei Pang
    [ Improve commit message clarity. ]
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-16-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • As part of addressing in-kernel y2038 issues, this patch adds
    update_persistent_clock64() and replaces all the call sites of
    update_persistent_clock() with this function. This is a __weak
    implementation, which simply calls the existing y2038 unsafe
    update_persistent_clock().

    This allows architecture specific implementations to be
    converted independently, and eventually y2038-unsafe
    update_persistent_clock() can be removed after all its
    architecture specific implementations have been converted to
    update_persistent_clock64().

    Suggested-by: Arnd Bergmann
    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-4-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • As part of addressing in-kernel y2038 issues, this patch adds
    read_persistent_clock64() and replaces all the call sites of
    read_persistent_clock() with this function. This is a __weak
    implementation, which simply calls the existing y2038 unsafe
    read_persistent_clock().

    This allows architecture specific implementations to be
    converted independently, and eventually the y2038 unsafe
    read_persistent_clock() can be removed after all its
    architecture specific implementations have been converted to
    read_persistent_clock64().

    Suggested-by: Arnd Bergmann
    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-3-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     
  • As part of addressing in-kernel y2038 issues, this patch adds
    read_boot_clock64() and replaces all the call sites of
    read_boot_clock() with this function. This is a __weak
    implementation, which simply calls the existing y2038 unsafe
    read_boot_clock().

    This allows architecture specific implementations to be
    converted independently, and eventually the y2038 unsafe
    read_boot_clock() can be removed after all its architecture
    specific implementations have been converted to
    read_boot_clock64().

    Suggested-by: Arnd Bergmann
    Signed-off-by: Xunlei Pang
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/1427945681-29972-2-git-send-email-john.stultz@linaro.org
    Signed-off-by: Ingo Molnar

    Xunlei Pang
     

02 Apr, 2015

5 commits

  • Remove one CONFIG_HOTPLUG_CPU #ifdef in trade for introducing one
    CONFIG_SMP #ifdef.

    The CONFIG_SMP ifdef avoids declaring the per-CPU __tvec_bases storage
    on UP systems since they already have boot_tvec_bases.

    Also (re)add a runtime check on the base alignment -- for the paranoid
    amongst us :-)

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Viresh Kumar
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/fdd2d35e169bdc554ffa3fe77f77716298c75ada.1427814611.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • There is no need to call init_timers_cpu() on every CPU hotplug event,
    there is not much we need to reset.

    - Timer-lists are already empty at the end of migrate_timers().
    - timer_jiffies will be refreshed while adding a new timer, after the
    CPU is online again.
    - active_timers and all_timers can be reset from migrate_timers().

    Signed-off-by: Viresh Kumar
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/54a1c30ea7b805af55beb220cadf5a07a21b0a4d.1427814611.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar
     
  • Memory for the 'tvec_base' array is allocated separately for the boot CPU (statically)
    and non-boot CPUs (dynamically).

    The reason is because __TIMER_INITIALIZER() needs to set ->base to a
    valid pointer (because we've made NULL special, hint: lock_timer_base())
    and we cannot get a compile time pointer to per-cpu entries because we
    don't know where we'll map the section, even for the boot cpu.

    This can be simplified a bit by statically allocating per-cpu memory.
    The only disadvantage is that memory for one of the structures will stay
    unused, i.e. for the boot CPU, which uses boot_tvec_bases.

    This will also guarantee that tvec_base is cacheline aligned. Even
    though tvec_base has ____cacheline_aligned stuck on, kzalloc_node() does
    not actually respect that (but guarantees a minimum u64 alignment).

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Viresh Kumar
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/17cdf560f2727f687ab159707d0aa591f8a2f82d.1427814611.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • It was found when doing a hotplug stress test on POWER, that the
    machine either hit softlockups or rcu_sched stall warnings. The
    issue was traced to commit:

    7cba160ad789 ("powernv/cpuidle: Redesign idle states management")

    which exposed the cpu_down() race with hrtimer based broadcast mode:

    5d1638acb9f6 ("tick: Introduce hrtimer based broadcast")

    The race is the following:

    Assume CPU1 is the CPU which holds the hrtimer broadcasting duty
    before it is taken down.

    CPU0 CPU1

    cpu_down() take_cpu_down()
    disable_interrupts()

    cpu_die()

    while (CPU1 != CPU_DEAD) {
    msleep(100);
    switch_to_idle();
    stop_cpu_timer();
    schedule_broadcast();
    }

    tick_cleanup_cpu_dead()
    take_over_broadcast()

    So after CPU1 disabled interrupts it cannot handle the broadcast
    hrtimer anymore, so CPU0 will be stuck forever.

    Fix this by explicitly taking over broadcast duty before cpu_die().

    This is a temporary workaround. What we really want is a callback
    in the clockevent device which allows us to do that from the dying
    CPU by pushing the hrtimer onto a different cpu. That might involve
    an IPI and is definitely more complex than this immediate fix.

    Changelog was picked up from:

    https://lkml.org/lkml/2015/2/16/213

    Suggested-by: Thomas Gleixner
    Tested-by: Nicolas Pitre
    Signed-off-by: Preeti U. Murthy
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: mpe@ellerman.id.au
    Cc: nicolas.pitre@linaro.org
    Cc: peterz@infradead.org
    Cc: rjw@rjwysocki.net
    Fixes: http://linuxppc.10917.n7.nabble.com/offlining-cpus-breakage-td88619.html
    Link: http://lkml.kernel.org/r/20150330092410.24979.59887.stgit@preeti.in.ibm.com
    [ Merged it to the latest timer tree, renamed the callback, tidied up the changelog. ]
    Signed-off-by: Ingo Molnar

    Preeti U Murthy
     
  • Move the broadcasting related section to the GENERIC_CLOCKEVENTS=y
    section - this also solves build failures on architectures that
    don't use generic clockevents yet.

    Also standardize include file style to make it easier to read, and
    use nesting depth aware preprocessor directives to make future merges
    easier.

    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

01 Apr, 2015

9 commits

  • Use the new tick_suspend/resume_local() and get rid of the
    homebrewn implementation of these in the ARM bL switcher. The
    check for the cpumask is completely pointless. There is no harm
    to suspend a per cpu tick device unconditionally. If that's a
    real issue then we fix it proper at the core level and not with
    some completely undocumented hacks in some random core code.

    Move the tick internals to the core code, now that this nuisance
    is gone.

    Signed-off-by: Thomas Gleixner
    [ rjw: Rebase, changelog ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Nicolas Pitre
    Cc: Peter Zijlstra
    Cc: Russell King
    Link: http://lkml.kernel.org/r/1655112.Ws17YsMfN7@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Xen calls on every cpu into tick_resume() which is just wrong.
    tick_resume() is for the syscore global suspend/resume
    invocation. What XEN really wants is a per cpu local resume
    function.

    Provide a tick_resume_local() function and use it in XEN.

    Also provide a complementary tick_suspend_local() and modify
    tick_unfreeze() and tick_freeze(), respectively, to use the
    new local tick resume/suspend functions.

    Signed-off-by: Thomas Gleixner
    [ Combined two patches, rebased, modified subject/changelog. ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Boris Ostrovsky
    Cc: David Vrabel
    Cc: Konrad Rzeszutek Wilk
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1698741.eezk9tnXtG@vostro.rjw.lan
    [ Merged to latest timers/core. ]
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Solely used in tick-broadcast.c and the return value is
    hardcoded 0. Make it static and void.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1689058.QkHYDJSRKu@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • clockevents_notify() is a leftover from the early design of the
    clockevents facility. It's really not a notification mechanism,
    it's a multiplex call.

    We are way better off to have explicit calls instead of this
    monstrosity. Split out the suspend/resume() calls and invoke
    them directly from the call sites.

    No locking required at this point because these calls happen
    with interrupts disabled and a single cpu online.

    Signed-off-by: Thomas Gleixner
    [ Rebased on top of 4.0-rc5. ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/713674030.jVm1qaHuPf@vostro.rjw.lan
    [ Rebased on top of latest timers/core. ]
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Called with 'clockevents_lock' held and interrupts disabled
    already.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/51005827.yXt5tjZMBs@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • No point to expose everything to the world. People just believe
    such functions can be abused for whatever purposes. Sigh.

    Signed-off-by: Thomas Gleixner
    [ Rebased on top of 4.0-rc5 ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Nicolas Pitre
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/28017337.VbCUc39Gme@vostro.rjw.lan
    [ Merged to latest timers/core ]
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • tick-internal.h is pretty confusing as a lot of the stub inlines
    are there several times.

    Distangle the maze and make clear functional sections.

    Signed-off-by: Thomas Gleixner
    [ rjw: Subject ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/16068264.vcNp79HLaT@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • Move clocksource related stuff to timekeeping.h and remove the
    pointless include from ntp.c

    Signed-off-by: Thomas Gleixner
    [ rjw: Subject ]
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/2714218.nM5AEfAHj0@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     
  • This option was for simpler migration to the clock events code.
    Most architectures have been converted and the option has been
    disfunctional as a standalone option for quite some time. Remove
    it.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Rafael J. Wysocki
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/5021859.jl9OC1medj@vostro.rjw.lan
    Signed-off-by: Ingo Molnar

    Thomas Gleixner
     

31 Mar, 2015

1 commit


27 Mar, 2015

4 commits

  • It was a requirement in the legacy interface that drivers must
    initialize ->mode field to 'CLOCK_EVT_MODE_UNUSED'. This field
    isn't used anymore by the new interface and so should be only
    checked for the legacy interface.

    Probably it can be dropped as well as core doesn't rely on it
    anymore, but lets keep it to support legacy interface.

    Signed-off-by: Viresh Kumar
    Acked-by: Peter Zijlstra
    Cc: Daniel Lezcano
    Cc: Frederic Weisbecker
    Cc: Kevin Hilman
    Cc: Peter Zijlstra
    Cc: Preeti U Murthy
    Cc: linaro-kernel@lists.linaro.org
    Cc: linaro-networking@linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/c6604fa1a77fe1fc8dcab87769857228fb1dadd5.1425037853.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar
     
  • 'enum clock_event_mode' is used for two purposes today:

    - to pass mode to the driver of clockevent device::set_mode().

    - for managing state of the device for clockevents core.

    For supporting new modes/states we have moved away from the
    legacy set_mode() callback to new per-mode/state callbacks. New
    modes/states shouldn't be exposed to the legacy (now OBSOLOTE)
    callbacks and so we shouldn't add new states to 'enum
    clock_event_mode'.

    Lets have separate enums for the two use cases mentioned above.
    Keep using the earlier enum for legacy set_mode() callback and
    mark it OBSOLETE. And add another enum to clearly specify the
    possible states of a clockevent device.

    This also renames the newly added per-mode callbacks to reflect
    state changes.

    We haven't got rid of 'mode' member of 'struct
    clock_event_device' as it is used by some of the clockevent
    drivers and it would automatically die down once we migrate
    those drivers to the new interface. It ('mode') is only updated
    now for the drivers using the legacy interface.

    Suggested-by: Peter Zijlstra
    Suggested-by: Ingo Molnar
    Signed-off-by: Viresh Kumar
    Acked-by: Peter Zijlstra
    Cc: Daniel Lezcano
    Cc: Frederic Weisbecker
    Cc: Kevin Hilman
    Cc: Preeti U Murthy
    Cc: linaro-kernel@lists.linaro.org
    Cc: linaro-networking@linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/b6b0143a8a57bd58352ad35e08c25424c879c0cb.1425037853.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar
     
  • Upcoming patch will redefine possible states of a clockevent
    device. The RESUME mode is a special case only for tick's
    clockevent devices. In future it can be replaced by ->resume()
    callback already available for clockevent devices.

    Lets handle it separately so that clockevents_set_mode() only
    handles states valid across all devices. This also renames
    set_mode_resume() to tick_resume() to make it more explicit.

    Signed-off-by: Viresh Kumar
    Acked-by: Peter Zijlstra
    Cc: Daniel Lezcano
    Cc: Frederic Weisbecker
    Cc: Kevin Hilman
    Cc: Peter Zijlstra
    Cc: Preeti U Murthy
    Cc: linaro-kernel@lists.linaro.org
    Cc: linaro-networking@linaro.org
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/c1b0112410870f49e7bf06958e1483eac6c15e20.1425037853.git.viresh.kumar@linaro.org
    Signed-off-by: Ingo Molnar

    Viresh Kumar
     
  • Add the NMI safe CLOCK_MONOTONIC_RAW accessor..

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: John Stultz
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/20150319093400.562746929@infradead.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra