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
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
+u64Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
Cc: John Stultz -
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
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
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-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
Acked-by: Maxime Coquelin
25 Feb, 2016
2 commits
-
set_state_oneshot_stopped() is called by the clkevt core, when the next
event is required at an expiry time of 'KTIME_MAX'. This normally
happens with NO_HZ_{IDLE|FULL} in both LOWRES/HIGHRES modes.This patch makes the clockevent device to stop on such an event, to
avoid spurious interrupts, as explained by: commit 8fff52fd5093
("clockevents: Introduce CLOCK_EVT_STATE_ONESHOT_STOPPED state").Signed-off-by: Viresh Kumar
Signed-off-by: Daniel Lezcano -
Provide a delay timer using the lower 32-bits of the global timer so
that we can use that instead of having to calibrating delays.Signed-off-by: Rabin Vincent
Signed-off-by: Daniel Lezcano
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 = 0Hence, 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 -
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 averageimproved by 70%!
Signed-off-by: Jisheng Zhang
Signed-off-by: Daniel Lezcano
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
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
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
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
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
02 Oct, 2013
1 commit
-
The arm_global_timer is a per cpu device. Set the appropriate flag.
Signed-off-by: Soren Brinkmann
Signed-off-by: Daniel Lezcano
Acked-by: Michal Simek
Acked-by: Srinivas Kandagatla
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
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