Commit Graph
4 Commits
Author SHA1 Message Date
Arnd Bergmann dde7632ed0 clocksource/fsl: Avoid harmless 64-bit warnings
The ftm_clockevent_init passes the value of "~0UL" into a function
that takes a 32-bit argument, which drops the upper 32 bits, as
gcc warns about on ARM64:

clocksource/fsl_ftm_timer.c: In function 'ftm_clockevent_init':
clocksource/fsl_ftm_timer.c:206:13: warning: large integer implicitly truncated to unsigned type [-Woverflow]

This was obviously unintended behavior, and is easily avoided by
using '~0u' as the integer literal, because that is 32-bit wide
on all architectures.

Signed-off-by: Arnd Bergmann <[email protected]>
Cc: [email protected]
Cc: Xiubo Li <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Link: http://lkml.kernel.org/r/3990834.xnjhm37Grs@wuerfel
Signed-off-by: Thomas Gleixner <[email protected]>
2015-11-16 19:07:08 +01:00
Jisheng Zhang bd859a44b2 clocksource/drivers/fsl_ftm_timer: Prevent ftrace recursion
Having a traceable function in the sched_clock() path leads to a recursion
within ftrace and a kernel crash.

We should not trace the ftm_read_sched_clock() function.

Fix this by adding the notrace attribute to this function.

Signed-off-by: Jisheng Zhang <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
2015-10-27 01:34:07 +01:00
Viresh Kumar 7376634018 clockevents/drivers/fsl_ftm: Migrate to new 'set-state' interface
Migrate fsl_ftm 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: Xiubo Li <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
2015-08-10 11:40:29 +02:00
Xiubo Li 2529c3a330 clocksource: Add Freescale FlexTimer Module (FTM) timer support
The Freescale FlexTimer Module time reference is a 16-bit counter
that can be used as an unsigned or signed increase counter.

CNTIN defines the starting value of the count and MOD defines the
final value of the count. The value of CNTIN is loaded into the FTM
counter, and the counter increments until the value of MOD is reached,
at which point the counter is reloaded with the value of CNTIN. That's
also when an overflow interrupt will be generated.

Here using the 'evt' prefix or postfix as clock event device and
the 'src' as clock source device.

Signed-off-by: Xiubo Li <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Jingchang Lu <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
2014-05-23 10:12:04 +02:00