14 Jun, 2017

1 commit

  • The CLOCKSOURCE_OF_DECLARE macro is used widely for the timers to declare the
    clocksource at early stage. However, this macro is also used to initialize
    the clockevent if any, or the clockevent only.

    It was originally suggested to declare another macro to initialize a
    clockevent, so in order to separate the two entities even they belong to the
    same IP. This was not accepted because of the impact on the DT where splitting
    a clocksource/clockevent definition does not make sense as it is a Linux
    concept not a hardware description.

    On the other side, the clocksource has not interrupt declared while the
    clockevent has, so it is easy from the driver to know if the description is
    for a clockevent or a clocksource, IOW it could be implemented at the driver
    level.

    So instead of dealing with a named clocksource macro, let's use a more generic
    one: TIMER_OF_DECLARE.

    The patch has not functional changes.

    Signed-off-by: Daniel Lezcano
    Acked-by: Heiko Stuebner
    Acked-by: Neil Armstrong
    Acked-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Reviewed-by: Linus Walleij

    Daniel Lezcano
     

07 Apr, 2017

1 commit


25 Dec, 2016

1 commit

  • 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
     

17 Aug, 2016

1 commit

  • While converting the init function to return an error, the wrong clock
    was get. This leads to the wrong clock rate and slows down the kernel.
    For example, it affects typical boot time:

    - without fix: over 1 minute
    - with fix: 15 seconds

    Tested-by: Stefan Roese
    Tested-by: Ralph Sennhauser
    Signed-off-by: Gregory CLEMENT
    Signed-off-by: Daniel Lezcano
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: 12549e27c63c ("clocksource/drivers/time-armada-370-xp: Convert init function to return error")
    Link: http://lkml.kernel.org/r/1471429296-9053-1-git-send-email-daniel.lezcano@linaro.org
    [ Refined the changelog. ]
    Signed-off-by: Ingo Molnar

    Gregory CLEMENT
     

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: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: rt@linutronix.de
    Link: http://lkml.kernel.org/r/20160713153338.229913786@linutronix.de
    Signed-off-by: Ingo Molnar

    Richard Cochran
     

12 Jul, 2016

1 commit

  • The failure check of armada_370_xp_timer_setup() in
    armada_370_xp_timer_common_init() is negated. This leads to an error message
    and exit in case of a successful initialization. Remove the stray '!'.

    Fixes: 12549e27c63c ("clocksource/drivers/time-armada-370-xp: Convert init function to return error")
    Signed-off-by: Anna-Maria Gleixner
    Cc: Daniel Lezcano
    Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1607121731020.1344@hypnos.tec.linutronix.de
    Signed-off-by: Thomas Gleixner

    Anna-Maria Gleixner
     

28 Jun, 2016

3 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

    Daniel Lezcano
     
  • The driver does not export armada_370_xp_timer_syscore_ops so
    make it static to fix the following warning:

    drivers/clocksource/time-armada-370-xp.c:249:20: warning: symbol 'armada_370_xp_timer_syscore_ops' was not declared. Should it be static?

    Signed-off-by: Ben Dooks
    Signed-off-by: Daniel Lezcano
    Acked-by: Gregory CLEMENT

    Ben Dooks
     

20 Oct, 2015

1 commit

  • Implement an ARM delay timer to be used for udelay() on Armada 37x
    platforms. This allows us to skip the delay loop calibration at boot,
    saving 180ms on the boot time of the kernel (which is around 10%).

    It also means that udelay() will be unaffected by CPU frequency changes
    when cpufreq is enabled on these platforms.

    Signed-off-by: Russell King
    Signed-off-by: Daniel Lezcano
    Tested-by: Gregory CLEMENT
    Acked-by: Gregory CLEMENT

    Russell King
     

10 Aug, 2015

1 commit

  • Migrate time-armada-370-xp driver to the new 'set-state' interface
    provided by 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.

    Cc: Jason Cooper
    Cc: Andrew Lunn
    Cc: Gregory Clement
    Cc: Sebastian Hesselbarth
    Signed-off-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano

    Viresh Kumar
     

11 Dec, 2014

1 commit

  • Pull timer core updates from Thomas Gleixner:
    "The time(r) departement provides:

    - more infrastructure work on the year 2038 issue

    - a few fixes in the Armada SoC timers

    - the usual pile of fixlets and improvements"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    clocksource: armada-370-xp: Use the reference clock on A375 SoC
    watchdog: orion: Use the reference clock on Armada 375 SoC
    clocksource: armada-370-xp: Add missing clock enable
    time: Fix sign bug in NTP mult overflow warning
    time: Remove timekeeping_inject_sleeptime()
    rtc: Update suspend/resume timing to use 64bit time
    rtc/lib: Provide y2038 safe rtc_tm_to_time()/rtc_time_to_tm() replacement
    time: Fixup comments to reflect usage of timespec64
    time: Expose get_monotonic_coarse64() for in-kernel uses
    time: Expose getrawmonotonic64 for in-kernel uses
    time: Provide y2038 safe mktime() replacement
    time: Provide y2038 safe timekeeping_inject_sleeptime() replacement
    time: Provide y2038 safe do_settimeofday() replacement
    time: Complete NTP adjustment threshold judging conditions
    time: Avoid possible NTP adjustment mult overflow.
    time: Rename udelay_test.c to test_udelay.c
    clocksource: sirf: Remove hard-coded clock rate

    Linus Torvalds
     

01 Dec, 2014

1 commit

  • This commit adds a set of suspend/resume syscore_ops to respectively
    save and restore a number of timer registers, in order to make sure
    the clockevent and clocksource devices continue to work properly
    across a suspend/resume cycle.

    Signed-off-by: Thomas Petazzoni
    Cc: Daniel Lezcano
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Acked-by: Daniel Lezcano
    Link: https://lkml.kernel.org/r/1416585613-2113-5-git-send-email-thomas.petazzoni@free-electrons.com
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     

26 Nov, 2014

2 commits

  • The 25 MHz reference clock has better stability so its use is preferred over the
    core clock.

    This commit takes advantage of the already introduced Armada 375 devicetree
    compatible string and adds a new timer initialization. If available, the timer
    will use the reference clock (named as 'fixed'). Otherwise, it falls back to the
    previous behavior.

    Acked-by: Jason Cooper
    Acked-by: Gregory CLEMENT
    Acked-by: Wim Van Sebroeck
    Reviewed-by: Thomas Petazzoni
    Tested-by: Thomas Petazzoni
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Daniel Lezcano

    Ezequiel Garcia
     
  • This commit makes sure the timer clock is prepared and enabled
    before retrieving its rate.

    Acked-by: Jason Cooper
    Acked-by: Gregory CLEMENT
    Acked-by: Wim Van Sebroeck
    Reviewed-by: Thomas Petazzoni
    Tested-by: Thomas Petazzoni
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Daniel Lezcano

    Ezequiel Garcia
     

12 Mar, 2014

1 commit


14 Jan, 2014

1 commit

  • Pull clocksource/clockevent updates from Daniel Lezcano:

    * Axel Lin removed an unused structure defining the ids for the
    bcm kona driver.

    * Ezequiel Garcia enabled the timer divider only when the 25MHz
    timer is not used for the armada 370 XP.

    * Jingoo Han removed a pointless platform data initialization for
    the sh_mtu and sh_mtu2.

    * Laurent Pinchart added the clk_prepare/clk_unprepare for sh_cmt.

    * Linus Walleij added a useful warning in clk_of when no clocks
    are found while the old behavior was to silently hang at boot time.

    * Maxime Ripard added the high speed timer drivers for the
    Allwinner SoCs (A10, A13, A20). He increased the rating, shared the
    irq across all available cpus and fixed the clockevent's irq
    initialization for the sun4i.

    * Michael Opdenacker removed the usage of the IRQF_DISABLED for the
    all the timers driver located in drivers/clocksource.

    * Stephen Boyd switched to sched_clock_register for the
    arm_global_timer, cadence_ttc, sun4i and orion timers.

    Conflicts:
    drivers/clocksource/clksrc-of.c

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

11 Dec, 2013

2 commits

  • The current code sets the timer divider bits always. However, when
    the 25 MHz timer is enabled, this is not needed and has no effect.
    As this causes some confusion, rework the code so the divider is
    set only when needed, i.e. when the 25 MHz timer is not in use.

    Acked-by: Gregory CLEMENT
    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Daniel Lezcano

    Ezequiel Garcia
     
  • This commit registers the sched_clock _after_ the counter reset
    (instead of before). This removes the timestamp 'jump' in kernel
    log messages.

    Before this change:

    [ 0.000000] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798691800ns
    [ 0.000000] Initializing Coherency fabric
    [ 0.000000] Aurora cache controller enabled
    [ 0.000000] l2x0: 16 ways, CACHE_ID 0x00000100, AUX_CTRL 0x1a696b12, Cache size: 1024 kB
    [ 163.507447] Calibrating delay loop... 1325.05 BogoMIPS (lpj=662528)
    [ 163.521419] pid_max: default: 32768 minimum: 301
    [ 163.526185] Mount-cache hash table entries: 512
    [ 163.531095] CPU: Testing write buffer coherency: ok

    After this change:

    [ 0.000000] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798691800ns
    [ 0.000000] Initializing Coherency fabric
    [ 0.000000] Aurora cache controller enabled
    [ 0.000000] l2x0: 16 ways, CACHE_ID 0x00000100, AUX_CTRL 0x1a696b12, Cache size: 1024 kB
    [ 0.016849] Calibrating delay loop... 1325.05 BogoMIPS (lpj=662528)
    [ 0.030820] pid_max: default: 32768 minimum: 301
    [ 0.035588] Mount-cache hash table entries: 512
    [ 0.040500] CPU: Testing write buffer coherency: ok

    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Daniel Lezcano
    Acked-by: Jason Cooper

    Ezequiel Garcia
     

27 Sep, 2013

1 commit


17 Sep, 2013

1 commit

  • Pull timer code update from Thomas Gleixner:
    - armada SoC clocksource overhaul with a trivial merge conflict
    - Minor improvements to various SoC clocksource drivers

    * 'timers/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    clocksource: armada-370-xp: Add detailed clock requirements in devicetree binding
    clocksource: armada-370-xp: Get reference fixed-clock by name
    clocksource: armada-370-xp: Replace WARN_ON with BUG_ON
    clocksource: armada-370-xp: Fix device-tree binding
    clocksource: armada-370-xp: Introduce new compatibles
    clocksource: armada-370-xp: Use CLOCKSOURCE_OF_DECLARE
    clocksource: armada-370-xp: Simplify TIMER_CTRL register access
    clocksource: armada-370-xp: Use BIT()
    ARM: timer-sp: Set dynamic irq affinity
    ARM: nomadik: add dynamic irq flag to the timer
    clocksource: sh_cmt: 32-bit control register support
    clocksource: em_sti: Convert to devm_* managed helpers

    Linus Torvalds
     

03 Sep, 2013

6 commits


31 Jul, 2013

1 commit


24 Jul, 2013

1 commit

  • …/davidb/linux-msm into next/cleanup

    From Stephen Boyd:

    Now that we have a generic arch hook for broadcast we can remove the
    local timer API entirely. Doing so will reduce code in ARM core, reduce
    the architecture dependencies of our timer drivers, and simplify the code
    because we no longer go through an architecture layer that is essentially
    a hotplug notifier.

    * tag 'remove-local-timers' of git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm:
    ARM: smp: Remove local timer API
    clocksource: time-armada-370-xp: Divorce from local timer API
    clocksource: time-armada-370-xp: Fix sparse warning
    ARM: msm: Divorce msm_timer from local timer API
    ARM: PRIMA2: Divorce timer-marco from local timer API
    ARM: EXYNOS4: Divorce mct from local timer API
    ARM: OMAP2+: Divorce from local timer API
    ARM: smp_twd: Divorce smp_twd from local timer API
    ARM: smp: Remove duplicate dummy timer implementation

    Resolved a large number of conflicts due to __cpuinit cleanups, etc.

    Signed-off-by: Olof Johansson <olof@lixom.net>

    Olof Johansson
     

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
     

25 Jun, 2013

2 commits


13 Jun, 2013

1 commit


01 Mar, 2013

1 commit


20 Nov, 2012

1 commit


10 Jul, 2012

1 commit