26 Dec, 2016

1 commit

  • Pull timer type cleanups from Thomas Gleixner:
    "This series does a tree wide cleanup of types related to
    timers/timekeeping.

    - Get rid of cycles_t and use a plain u64. The type is not really
    helpful and caused more confusion than clarity

    - Get rid of the ktime union. The union has become useless as we use
    the scalar nanoseconds storage unconditionally now. The 32bit
    timespec alike storage got removed due to the Y2038 limitations
    some time ago.

    That leaves the odd union access around for no reason. Clean it up.

    Both changes have been done with coccinelle and a small amount of
    manual mopping up"

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    ktime: Get rid of ktime_equal()
    ktime: Cleanup ktime_set() usage
    ktime: Get rid of the union
    clocksource: Use a plain u64 instead of cycle_t

    Linus Torvalds
     

25 Dec, 2016

2 commits

  • There is no point in having an extra type for extra confusion. u64 is
    unambiguous.

    Conversion was done with the following coccinelle script:

    @rem@
    @@
    -typedef u64 cycle_t;

    @fix@
    typedef cycle_t;
    @@
    -cycle_t
    +u64

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: John Stultz

    Thomas Gleixner
     
  • When the state names got added a script was used to add the extra argument
    to the calls. The script basically converted the state constant to a
    string, but the cleanup to convert these strings into meaningful ones did
    not happen.

    Replace all the useless strings with 'subsys/xxx/yyy:state' strings which
    are used in all the other places already.

    Signed-off-by: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Sebastian Siewior
    Link: http://lkml.kernel.org/r/20161221192112.085444152@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

15 Jul, 2016

1 commit

  • Install the callbacks via the state machine and let the core invoke
    the callbacks on the already online CPUs.

    Signed-off-by: Richard Cochran
    Signed-off-by: Anna-Maria Gleixner
    Reviewed-by: Sebastian Andrzej Siewior
    Cc: Daniel Lezcano
    Cc: Linus Torvalds
    Cc: Maxime Coquelin
    Cc: Patrice Chotard
    Cc: Peter Zijlstra
    Cc: Srinivas Kandagatla
    Cc: Thomas Gleixner
    Cc: kernel@stlinux.com
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153338.062741642@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     

28 Jun, 2016

2 commits

  • All the clocksource drivers's init function are now converted to return
    an error code. CLOCKSOURCE_OF_DECLARE is no longer used as well as the
    clksrc-of table.

    Let's convert back the names:
    - CLOCKSOURCE_OF_DECLARE_RET => CLOCKSOURCE_OF_DECLARE
    - clksrc-of-ret => clksrc-of

    Signed-off-by: Daniel Lezcano

    For exynos_mct and samsung_pwm_timer:
    Acked-by: Krzysztof Kozlowski

    For arch/arc:
    Acked-by: Vineet Gupta

    For mediatek driver:
    Acked-by: Matthias Brugger

    For the Rockchip-part
    Acked-by: Heiko Stuebner

    For STi :
    Acked-by: Patrice Chotard

    For the mps2-timer.c and versatile.c changes:
    Acked-by: Liviu Dudau

    For the OXNAS part :
    Acked-by: Neil Armstrong

    For LPC32xx driver:
    Acked-by: Sylvain Lemieux

    For Broadcom Kona timer change:
    Acked-by: Ray Jui

    For Sun4i and Sun5i:
    Acked-by: Chen-Yu Tsai

    For Meson6:
    Acked-by: Carlo Caione

    For Keystone:
    Acked-by: Santosh Shilimkar

    For NPS:
    Acked-by: Noam Camus

    For bcm2835:
    Acked-by: Eric Anholt

    Daniel Lezcano
     
  • The init functions do not return any error. They behave as the following:

    - panic, thus leading to a kernel crash while another timer may work and
    make the system boot up correctly

    or

    - print an error and let the caller unaware if the state of the system

    Change that by converting the init functions to return an error conforming
    to the CLOCKSOURCE_OF_RET prototype.

    Proper error handling (rollback, errno value) will be changed later case
    by case, thus this change just return back an error or success in the init
    function.

    Signed-off-by: Daniel Lezcano
    Acked-by: Maxime Coquelin

    Daniel Lezcano
     

25 Feb, 2016

2 commits


16 Dec, 2015

2 commits

  • Now the System stall is observed on TI AM437x based board (am437x-gp-evm)
    during resuming from System suspend when ARM Global timer is selected as
    clocksource device (CPUIdle not enabled) - SysRq are working, but nothing
    else.

    The reason of stall is that ARM Global timer loses its contexts during
    System suspend:
    GT_CONTROL.TIMER_ENABLE = 0 (unbanked)
    GT_COUNTERx = 0

    Hence, update ARM Global timer driver to reflect above behaviour
    - re-enable ARM Global timer on resume (GT_CONTROL.TIMER_ENABLE = 1)
    if not enabled.

    CC: Arnd Bergmann
    Cc: John Stultz
    Cc: Felipe Balbi
    Cc: Tony Lindgren
    Cc: Marc Zyngier
    Reviewed-by: Santosh Shilimkar
    Signed-off-by: Grygorii Strashko
    Signed-off-by: Daniel Lezcano

    Grygorii Strashko
     
  • Use the relaxed version to improve performance. we measured time of
    4096 rounds of gt_compare_set() spent on Marvell BG2Q:

    before the patch: 3690648ns on average
    after the patch: 1083023ns on average

    improved by 70%!

    Signed-off-by: Jisheng Zhang
    Signed-off-by: Daniel Lezcano

    Jisheng Zhang
     

27 Oct, 2015

1 commit

  • Currently arm_global_timer can be used as a scheduler clock. We properly
    marked gt_sched_clock_read() as notrace but we then call another function
    gt_counter_read() that _wasn't_ notrace.

    Having a traceable function in the sched_clock() path leads to a recursion
    within ftrace and a kernel crash.

    Fix this by adding an extra notrace function to keep other users of
    gt_counter_read() traceable.

    Signed-off-by: Jisheng Zhang
    Signed-off-by: Daniel Lezcano

    Jisheng Zhang
     

06 Aug, 2015

1 commit

  • Migrate arm_global_timer driver to the new 'set-state' interface
    provided by the clockevents core, the earlier 'set-mode' interface is
    marked obsolete now.

    This also enables us to implement callbacks for new states of clockevent
    devices, for example: ONESHOT_STOPPED.

    Acked-by: Daniel Lezcano
    Acked-by: Maxime Coquelin
    Acked-by: Srinivas Kandagatla
    Cc: Srinivas Kandagatla
    Cc: Maxime Coquelin
    Cc: Patrice Chotard
    Signed-off-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano

    Viresh Kumar
     

18 Jul, 2014

1 commit

  • Ensure that platform maintainers check the CPU part number in the right
    manner: the CPU part number is meaningless without also checking the
    CPU implement(e|o)r (choose your preferred spelling!) Provide an
    interface which returns both the implementer and part number together,
    and update the definitions to include the implementer.

    Mark the old function as being deprecated... indeed, using the old
    function with the definitions will now always evaluate as false, so
    people must update their un-merged code to the new function. While
    this could be avoided by adding new definitions, we'd also have to
    create new names for them which would be awkward.

    Acked-by: Nicolas Pitre
    Signed-off-by: Russell King

    Russell King
     

22 Apr, 2014

1 commit

  • The check for a usable global timer in the probe code does not enquire
    which CPU we are currently running on. This can cause the driver to
    incorrectly assume we have an unusable global timer if we are running
    on a CPU other than A9.

    Before checking the CPU revision, ensure we are running on an A9 CPU.

    Acked-by: Will Deacon
    Signed-off-by: Matthew Leach
    Signed-off-by: Daniel Lezcano

    Matthew Leach
     

11 Dec, 2013

1 commit

  • The 32 bit sched_clock interface now supports 64 bits. Upgrade to
    the 64 bit function to allow us to remove the 32 bit registration
    interface. While we're here increase the number of bits that
    sched_clock can handle to 64 to make full use of the counter.

    Cc: Stuart Menefy
    Cc: Srinivas Kandagatla
    Acked-by: Srinivas Kandagatla
    Acked-by: Stuart Menefy
    Signed-off-by: Stephen Boyd
    Signed-off-by: Daniel Lezcano

    Stephen Boyd
     

02 Oct, 2013

1 commit


15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    This removes all the drivers/clocksource and drivers/irqchip uses of
    the __cpuinit macros from all C files.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: John Stultz
    Cc: Thomas Gleixner
    Acked-by: Thomas Gleixner
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

03 Jul, 2013

1 commit

  • This is a simple driver for the global timer module found in the Cortex
    A9-MP cores from revision r1p0 onwards. This should be able to perform
    the functions of the system timer and the local timer in an SMP system.

    The global timer has the following features:
    The global timer is a 64-bit incrementing counter with an
    auto-incrementing feature. It continues incrementing after sending
    interrupts. The global timer is memory mapped in the private memory
    region.
    The global timer is accessible to all Cortex-A9 processors in the
    cluster. Each Cortex-A9 processor has a private 64-bit comparator that
    is used to assert a private interrupt when the global timer has reached
    the comparator value. All the Cortex-A9 processors in a design use the
    banked ID, ID27, for this interrupt. ID27 is sent to the Interrupt
    Controller as a Private Peripheral Interrupt. The global timer is
    clocked by PERIPHCLK.

    Signed-off-by: Stuart Menefy
    Signed-off-by: Srinivas Kandagatla
    CC: Arnd Bergmann
    CC: Rob Herring
    CC: Linus Walleij
    CC: Will Deacon
    CC: Thomas Gleixner
    Signed-off-by: Daniel Lezcano

    Stuart Menefy