mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clocksource/arm_arch_timer: mark arch_timer_read_counter() as notrace to avoid deadloop
@ 2019-06-11 15:21 Wei Li
  2019-06-11 15:25 ` Marc Zyngier
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Li @ 2019-06-11 15:21 UTC (permalink / raw)
  To: mark.rutland, marc.zyngier, daniel.lezcano, tglx
  Cc: huawei.libin, linux-arm-kernel, linux-kernel

According to arch_counter_register(), mark arch_counter_get_*() what
arch_timer_read_counter() can be as notrace to avoid deadloop when using
function_graph tracer.

 0xffff80028af23250 0xffff000010195e00 sched_clock+64
 0xffff80028af23290 0xffff0000101e83ec trace_clock_local+12
 0xffff80028af232a0 0xffff00001020e52c function_graph_enter+116
 0xffff80028af23300 0xffff00001009af9c prepare_ftrace_return+44
 0xffff80028af23320 0xffff00001009b0a8 ftrace_graph_caller+28
 0xffff80028af23330 0xffff000010b01918 arch_counter_get_cntvct+16
 0xffff80028af23340 0xffff000010195e00 sched_clock+64
 0xffff80028af23380 0xffff0000101e83ec trace_clock_local+12
 0xffff80028af23390 0xffff00001020e52c function_graph_enter+116
 0xffff80028af233f0 0xffff00001009af9c prepare_ftrace_return+44
 0xffff80028af23410 0xffff00001009b0a8 ftrace_graph_caller+28
 0xffff80028af23420 0xffff000010b01918 arch_counter_get_cntvct+16
 ...

Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")
Signed-off-by: Wei Li <liwei391@huawei.com>
---
 drivers/clocksource/arm_arch_timer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index b2a951a798e2..f4d5bd8fe906 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
 	return val;
 }
 
-static u64 arch_counter_get_cntpct_stable(void)
+static u64 notrace arch_counter_get_cntpct_stable(void)
 {
 	return __arch_counter_get_cntpct_stable();
 }
 
-static u64 arch_counter_get_cntpct(void)
+static u64 notrace arch_counter_get_cntpct(void)
 {
 	return __arch_counter_get_cntpct();
 }
 
-static u64 arch_counter_get_cntvct_stable(void)
+static u64 notrace arch_counter_get_cntvct_stable(void)
 {
 	return __arch_counter_get_cntvct_stable();
 }
 
-static u64 arch_counter_get_cntvct(void)
+static u64 notrace arch_counter_get_cntvct(void)
 {
 	return __arch_counter_get_cntvct();
 }
@@ -947,7 +947,7 @@ bool arch_timer_evtstrm_available(void)
 	return cpumask_test_cpu(raw_smp_processor_id(), &evtstrm_available);
 }
 
-static u64 arch_counter_get_cntvct_mem(void)
+static u64 notrace arch_counter_get_cntvct_mem(void)
 {
 	u32 vct_lo, vct_hi, tmp_hi;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] clocksource/arm_arch_timer: mark arch_timer_read_counter() as notrace to avoid deadloop
  2019-06-11 15:21 [PATCH] clocksource/arm_arch_timer: mark arch_timer_read_counter() as notrace to avoid deadloop Wei Li
@ 2019-06-11 15:25 ` Marc Zyngier
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Zyngier @ 2019-06-11 15:25 UTC (permalink / raw)
  To: Wei Li, mark.rutland, daniel.lezcano, tglx
  Cc: huawei.libin, linux-arm-kernel, linux-kernel

Hi Wei,

On 11/06/2019 16:21, Wei Li wrote:
> According to arch_counter_register(), mark arch_counter_get_*() what
> arch_timer_read_counter() can be as notrace to avoid deadloop when using
> function_graph tracer.
> 
>  0xffff80028af23250 0xffff000010195e00 sched_clock+64
>  0xffff80028af23290 0xffff0000101e83ec trace_clock_local+12
>  0xffff80028af232a0 0xffff00001020e52c function_graph_enter+116
>  0xffff80028af23300 0xffff00001009af9c prepare_ftrace_return+44
>  0xffff80028af23320 0xffff00001009b0a8 ftrace_graph_caller+28
>  0xffff80028af23330 0xffff000010b01918 arch_counter_get_cntvct+16
>  0xffff80028af23340 0xffff000010195e00 sched_clock+64
>  0xffff80028af23380 0xffff0000101e83ec trace_clock_local+12
>  0xffff80028af23390 0xffff00001020e52c function_graph_enter+116
>  0xffff80028af233f0 0xffff00001009af9c prepare_ftrace_return+44
>  0xffff80028af23410 0xffff00001009b0a8 ftrace_graph_caller+28
>  0xffff80028af23420 0xffff000010b01918 arch_counter_get_cntvct+16
>  ...
> 
> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")
> Signed-off-by: Wei Li <liwei391@huawei.com>

There is already a patch[1] queued for that. Hopefully Daniel
and Thomas will get this into mainline shortly.

Thanks,

	M.

[1] https://lore.kernel.org/lkml/20190524093600.11ca3cb2@gandalf.local.home/T/
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-11 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 15:21 [PATCH] clocksource/arm_arch_timer: mark arch_timer_read_counter() as notrace to avoid deadloop Wei Li
2019-06-11 15:25 ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®