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
07 Apr, 2017
1 commit
-
Printing with pr_* functions requires adding line break manually.
Signed-off-by: Rafał Miłecki
Acked-by: Thierry Reding
Signed-off-by: Daniel Lezcano
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
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 secondsTested-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
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
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
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-ofSigned-off-by: Daniel Lezcano
For exynos_mct and samsung_pwm_timer:
Acked-by: Krzysztof KozlowskiFor arch/arc:
Acked-by: Vineet GuptaFor mediatek driver:
Acked-by: Matthias BruggerFor the Rockchip-part
Acked-by: Heiko StuebnerFor STi :
Acked-by: Patrice ChotardFor the mps2-timer.c and versatile.c changes:
Acked-by: Liviu DudauFor the OXNAS part :
Acked-by: Neil ArmstrongFor LPC32xx driver:
Acked-by: Sylvain LemieuxFor Broadcom Kona timer change:
Acked-by: Ray JuiFor Sun4i and Sun5i:
Acked-by: Chen-Yu TsaiFor Meson6:
Acked-by: Carlo CaioneFor Keystone:
Acked-by: Santosh ShilimkarFor NPS:
Acked-by: Noam CamusFor bcm2835:
Acked-by: Eric Anholt -
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 correctlyor
- 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
-
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
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
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
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
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
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 -
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
12 Mar, 2014
1 commit
-
Replace the driver-specific thread-safe shared register API
by the recently introduced atomic_io_clear_set().Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
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.cSigned-off-by: 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 -
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: okAfter 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: okSigned-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Acked-by: Jason Cooper
27 Sep, 2013
1 commit
-
Update to tip/timers/core and resolve minor conflict.
Conflicts:
drivers/clocksource/samsung_pwm_timer.cSigned-off-by: John Stultz
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
03 Sep, 2013
6 commits
-
The Armada XP timer has two mandatory clock inputs: nbclk and refclk,
as specified by the device-tree binding.This commit fixes the clock selection. Instead of hard-coding the clock
rate for the 25 MHz reference fixed-clock, obtain the clock by its name.Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Acked-by: Jason Cooper
Acked-by: Gregory CLEMENT -
If the clock fails to be obtained and the timer fails to be properly
registered, the kernel will freeze real soon. Instead, let's BUG()
where the actual problem is located.Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Acked-by: Jason Cooper
Acked-by: Gregory CLEMENT -
The Armada XP SoC clocksource driver cannot work without the 25 MHz
fixed timer. Therefore it's appropriate to introduce a new compatible
string and use it to set the 25 MHz fixed timer.The 'marvell,timer-25MHz' property will be marked as deprecated.
Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Reviewed-by: Andrew Lunn -
This is almost cosmetic: we achieve a bit of consistency with
other clocksource drivers by using the CLOCKSOURCE_OF_DECLARE
macro for the boilerplate code.Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Reviewed-by: Andrew Lunn -
This commit creates two functions to access the TIMER_CTRL register:
one for global one for the per-cpu. This makes the code much more
readable. In addition, since the TIMER_CTRL register is also used for
watchdog, this is preparation work for future thread-safe improvements.Acked-by: Gregory CLEMENT
Reviewed-by: Andrew Lunn
Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano -
This is a purely cosmetic commit: we replace hardcoded values that
representing bits by BIT(), which is slightly more readable.Signed-off-by: Ezequiel Garcia
Signed-off-by: Daniel Lezcano
Reviewed-by: Andrew Lunn
31 Jul, 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.Cc: Gregory CLEMENT
Signed-off-by: Stephen Boyd
Signed-off-by: John Stultz
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 implementationResolved a large number of conflicts due to __cpuinit cleanups, etc.
Signed-off-by: Olof Johansson <olof@lixom.net>
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
25 Jun, 2013
2 commits
-
Separate the armada 370xp local timers from the local timer API.
This will allow us to remove ARM local timer support in the near
future and makes this driver multi-architecture friendly.Acked-by: Gregory CLEMENT
Tested-by: Gregory CLEMENT
Acked-by: Marc Zyngier
Signed-off-by: Stephen Boyd -
drivers/clocksource/time-armada-370-xp.c:217:13: warning: symbol
'armada_370_xp_timer_init' was not declared. Should it be static?Also remove the __init marking in the prototype as it's
unnecessary and drop the init.h file.Acked-by: Gregory CLEMENT
Acked-by: Marc Zyngier
Signed-off-by: Stephen Boyd
13 Jun, 2013
1 commit
-
Nothing about the sched_clock implementation in the ARM port is
specific to the architecture. Generalize the code so that other
architectures can use it by selecting GENERIC_SCHED_CLOCK.Signed-off-by: Stephen Boyd
[jstultz: Merge minor collisions with other patches in my tree]
Signed-off-by: John Stultz
01 Mar, 2013
1 commit
-
On the SOCs Armada 370 and Armada XP, each CPU comes with two private
timers. This patch use the timer 0 of each CPU as local timer for the
clockevent if CONFIG_LOCAL_TIMER is selected. In the other case, use
only the private Timer 0 of CPU 0.Signed-off-by: Gregory CLEMENT
Signed-off-by: Jason Cooper
20 Nov, 2012
1 commit
-
Signed-off-by: Gregory CLEMENT
Tested-by Gregory CLEMENT
10 Jul, 2012
1 commit
-
Timer 0 is used as free-running clocksource, while timer 1 is used as
clock_event_device.Signed-off-by: Gregory CLEMENT
Signed-off-by: Thomas Petazzoni
Signed-off-by: Lior Amsalem
Reviewed-by: Thomas Gleixner
Tested-by: Yehuda Yitschak
Tested-by: Lior Amsalem
Acked-by: Andrew Lunn
CC: Thomas Gleixner
CC: John Stultz