[3/3] arm: arch_timer: mark functions as __always_inline

Message ID 20190603091512.25298-1-anders.roxell@linaro.org
State New
Headers show
Series
  • [1/3] clocksource/arm_arch_timer: mark arch_counter_get_* as notrace
Related show

Commit Message

Anders Roxell June 3, 2019, 9:15 a.m.
If CONFIG_FUNCTION_GRAPH_TRACER is enabled function
arch_counter_get_cntvct() is marked as notrace. However, function
__arch_counter_get_cntvct is marked as inline. If
CONFIG_OPTIMIZE_INLINING is set that will make the two functions
tracable which they shouldn't.

Rework so that functions __arch_counter_get_* are marked with
__always_inline so they will be inlined even if CONFIG_OPTIMIZE_INLINING
is turned on.

Originally found on arm64, but doing the same thing on arm for
consistency.

Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

---
 arch/arm/include/asm/arch_timer.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.20.1

Comments

Marc Zyngier June 5, 2019, 12:24 p.m. | #1
On 03/06/2019 10:15, Anders Roxell wrote:
> If CONFIG_FUNCTION_GRAPH_TRACER is enabled function

> arch_counter_get_cntvct() is marked as notrace. However, function

> __arch_counter_get_cntvct is marked as inline. If

> CONFIG_OPTIMIZE_INLINING is set that will make the two functions

> tracable which they shouldn't.

> 

> Rework so that functions __arch_counter_get_* are marked with

> __always_inline so they will be inlined even if CONFIG_OPTIMIZE_INLINING

> is turned on.

> 

> Originally found on arm64, but doing the same thing on arm for

> consistency.

> 

> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>


Acked-by: Marc Zyngier <marc.zyngier@arm.com>


	M.
-- 
Jazz is not dead. It just smells funny...

Patch

diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index 4b66ecd6be99..73a72ce41dc3 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -83,7 +83,7 @@  static inline u32 arch_timer_get_cntfrq(void)
 	return val;
 }
 
-static inline u64 __arch_counter_get_cntpct(void)
+static __always_inline u64 __arch_counter_get_cntpct(void)
 {
 	u64 cval;
 
@@ -92,12 +92,12 @@  static inline u64 __arch_counter_get_cntpct(void)
 	return cval;
 }
 
-static inline u64 __arch_counter_get_cntpct_stable(void)
+static __always_inline u64 __arch_counter_get_cntpct_stable(void)
 {
 	return __arch_counter_get_cntpct();
 }
 
-static inline u64 __arch_counter_get_cntvct(void)
+static __always_inline u64 __arch_counter_get_cntvct(void)
 {
 	u64 cval;
 
@@ -106,7 +106,7 @@  static inline u64 __arch_counter_get_cntvct(void)
 	return cval;
 }
 
-static inline u64 __arch_counter_get_cntvct_stable(void)
+static __always_inline u64 __arch_counter_get_cntvct_stable(void)
 {
 	return __arch_counter_get_cntvct();
 }