linux-sg2042/drivers/clocksource
Zong Li 9d05c18e8d clocksource: riscv: add notrace to riscv_sched_clock
When enabling ftrace graph tracer, it gets the tracing clock in
ftrace_push_return_trace().  Eventually, it invokes riscv_sched_clock()
to get the clock value.  If riscv_sched_clock() isn't marked with
'notrace', it will call ftrace_push_return_trace() and cause infinite
loop.

The result of failure as follow:

command: echo function_graph >current_tracer
[   46.176787] Unable to handle kernel paging request at virtual address ffffffe04fb38c48
[   46.177309] Oops [#1]
[   46.177478] Modules linked in:
[   46.177770] CPU: 0 PID: 256 Comm: $d Not tainted 5.5.0-rc1 #47
[   46.177981] epc: ffffffe00035e59a ra : ffffffe00035e57e sp : ffffffe03a7569b0
[   46.178216]  gp : ffffffe000d29b90 tp : ffffffe03a756180 t0 : ffffffe03a756968
[   46.178430]  t1 : ffffffe00087f408 t2 : ffffffe03a7569a0 s0 : ffffffe03a7569f0
[   46.178643]  s1 : ffffffe00087f408 a0 : 0000000ac054cda4 a1 : 000000000087f411
[   46.178856]  a2 : 0000000ac054cda4 a3 : 0000000000373ca0 a4 : ffffffe04fb38c48
[   46.179099]  a5 : 00000000153e22a8 a6 : 00000000005522ff a7 : 0000000000000005
[   46.179338]  s2 : ffffffe03a756a90 s3 : ffffffe00032811c s4 : ffffffe03a756a58
[   46.179570]  s5 : ffffffe000d29fe0 s6 : 0000000000000001 s7 : 0000000000000003
[   46.179809]  s8 : 0000000000000003 s9 : 0000000000000002 s10: 0000000000000004
[   46.180053]  s11: 0000000000000000 t3 : 0000003fc815749c t4 : 00000000000efc90
[   46.180293]  t5 : ffffffe000d29658 t6 : 0000000000040000
[   46.180482] status: 0000000000000100 badaddr: ffffffe04fb38c48 cause: 000000000000000f

Signed-off-by: Zong Li <zong.li@sifive.com>
Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
[paul.walmsley@sifive.com: cleaned up patch description]
Fixes: 92e0d143fd ("clocksource/drivers/riscv_timer: Provide the sched_clock")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
2020-01-04 21:48:48 -08:00
..
Kconfig clocksource/drivers/renesas-ostm: Convert to timer_of 2019-11-04 10:38:46 +01:00
Makefile clocksource: Add a new timer-ingenic driver 2019-08-08 15:30:08 -07:00
acpi_pm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 243 2019-06-19 17:09:07 +02:00
arc_timer.c Merge branch 'timers/vdso' into timers/core 2019-07-03 10:50:21 +02:00
arm_arch_timer.c Merge branch 'timers/vdso' into timers/core 2019-07-03 10:50:21 +02:00
arm_global_timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
armv7m_systick.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
asm9260_timer.c clocksource/drivers/asm9260: Add a check for of_clk_get 2019-11-04 10:40:10 +01:00
bcm2835_timer.c clocksource/drivers/bcm2835: Switch to SPDX identifier 2018-12-18 22:22:23 +01:00
bcm_kona_timer.c clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE 2017-06-14 11:58:45 +02:00
clksrc-dbx500-prcmu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 197 2019-05-30 11:29:22 -07:00
clksrc_st_lpc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clps711x-timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
dummy_timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dw_apb_timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dw_apb_timer_of.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
em_sti.c clocksource: Remove dev_err() usage after platform_get_irq() 2019-08-27 00:31:39 +02:00
exynos_mct.c Merge branch 'timers/vdso' into timers/core 2019-07-03 10:50:21 +02:00
h8300_timer8.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
h8300_timer16.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
h8300_tpu.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hyperv_timer.c x86/hyperv: Initialize clockevents earlier in CPU onlining 2019-11-15 10:33:49 +01:00
i8253.c clockevents/drivers/i8253: Add support for PIT shutdown quirk 2018-11-04 11:04:46 +01:00
ingenic-timer.c clocksource: Add a new timer-ingenic driver 2019-08-08 15:30:08 -07:00
jcore-pit.c clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE 2017-06-14 11:58:45 +02:00
mips-gic-timer.c clocksource/drivers/mips-gic-timer: Make gic_compare_irqaction static 2019-03-22 22:59:33 +01:00
mmio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mps2-timer.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
mxs_timer.c clocksource/drivers/mxs_timer: Switch to SPDX identifier 2018-05-23 07:39:09 +02:00
nomadik-mtu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
numachip.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
renesas-ostm.c clocksource/drivers/renesas-ostm: Use unique device name instead of ostm 2019-11-04 10:38:46 +01:00
samsung_pwm_timer.c clocksource: samsung_pwm_timer: Use pr_warn instead of pr_warning 2019-10-18 15:00:20 +02:00
scx200_hrt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sh_cmt.c sh: add the sh_ prefix to early platform symbols 2019-10-07 13:50:48 +02:00
sh_mtu2.c Driver core patches for 5.5-rc1 2019-11-27 11:06:20 -08:00
sh_tmu.c sh: add the sh_ prefix to early platform symbols 2019-10-07 13:50:48 +02:00
timer-armada-370-xp.c clocksource/drivers: Unify the names to timer-* format 2018-10-03 14:37:02 +02:00
timer-atcpit100.c clocksource/drivers: Set clockevent device cpumask to cpu_possible_mask 2018-07-26 11:26:30 +02:00
timer-atlas7.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
timer-atmel-pit.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
timer-atmel-st.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer-atmel-tcb.c clocksource/drivers/tcb_clksrc: Register delay timer 2019-08-27 00:31:39 +02:00
timer-cadence-ttc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
timer-cs5535.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206 2019-05-30 11:29:53 -07:00
timer-davinci.c clocksource/drivers/davinci: Add support for clocksource 2019-06-25 20:46:14 +02:00
timer-digicolor.c clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE 2017-06-14 11:58:45 +02:00
timer-efm32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
timer-fsl-ftm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
timer-fttmr010.c clocksource/drivers/fttmr010: Fix invalid interrupt register access 2018-12-18 22:22:23 +01:00
timer-gx6605s.c clocksource/drivers/c-sky: Add gx6605s SOC system timer 2018-11-02 19:41:12 +01:00
timer-imx-gpt.c clocksource/drivers/imx-gpt: Remove unnecessary irq protection 2018-12-18 22:22:23 +01:00
timer-imx-sysctr.c clocksource/drivers/imx-sysctr: Add internal clock divider handle 2019-08-27 00:31:39 +02:00
timer-imx-tpm.c clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of 2018-12-18 22:22:23 +01:00
timer-integrator-ap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer-ixp4xx.c clocksource/drivers/ixp4xx: Implement delay timer 2019-06-25 19:49:18 +02:00
timer-keystone.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
timer-lpc32xx.c clocksource/drivers: Unify the names to timer-* format 2018-10-03 14:37:02 +02:00
timer-mediatek.c clocksource/drivers/mediatek: Fix error handling 2019-10-16 17:04:50 +02:00
timer-meson6.c clocksource/drivers/timer-meson6: Update with SPDX Licence identifier 2019-06-25 19:49:18 +02:00
timer-milbeaut.c clocksource/drivers/timer-milbeaut: Cleanup common register accesses 2019-05-02 21:55:58 +02:00
timer-mp-csky.c clocksource/drivers/c-sky: fixup ftrace call-graph panic 2018-12-31 23:17:23 +08:00
timer-npcm7xx.c clocksource/drivers/npcm: Fix GENMASK and timer operation 2019-08-27 00:31:39 +02:00
timer-nps.c clocksource/drivers: Rename CLOCKSOURCE_OF_DECLARE to TIMER_OF_DECLARE 2017-06-14 11:58:45 +02:00
timer-of.c - Some cleanups for the timer-of, use %p0F and the unique device name 2019-11-04 18:49:13 +01:00
timer-of.h clocksource/drivers/timer-of: Store the device node pointer in 'struct timer_of' 2018-01-08 17:57:24 +01:00
timer-orion.c clocksource/drivers: Unify the names to timer-* format 2018-10-03 14:37:02 +02:00
timer-owl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
timer-oxnas-rps.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
timer-pistachio.c clocksource/drivers: Unify the names to timer-* format 2018-10-03 14:37:02 +02:00
timer-prima2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
timer-probe.c clocksource/drivers: Do not warn on probe defer 2019-08-27 00:31:39 +02:00
timer-pxa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
timer-qcom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
timer-rda.c clocksource/drivers/rda: Add clock driver for RDA8810PL SoC 2018-12-18 22:22:23 +01:00
timer-riscv.c clocksource: riscv: add notrace to riscv_sched_clock 2020-01-04 21:48:48 -08:00
timer-rockchip.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
timer-sp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timer-sp804.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer-sprd.c clocksource/drivers/sprd: Register one always-on timer to compensate suspend time 2018-07-26 11:26:34 +02:00
timer-stm32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
timer-sun4i.c clocksource: sun4i: Add missing compatibles 2019-08-27 00:31:39 +02:00
timer-sun5i.c clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable 2019-02-23 12:13:45 +01:00
timer-tango-xtal.c clocksource/drivers/tango-xtal: Rename the file for consistency 2019-02-23 12:13:45 +01:00
timer-tegra.c clocksource/drivers/tegra: Set up maximum-ticks limit properly 2019-06-25 19:49:18 +02:00
timer-ti-32k.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 341 2019-06-05 17:37:07 +02:00
timer-ti-dm.c clocksource/drivers/timer-ti-dm: Change to new style declaration 2019-05-24 15:51:30 +02:00
timer-u300.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 194 2019-05-30 11:29:22 -07:00
timer-versatile.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
timer-vf-pit.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
timer-vt8500.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
timer-zevio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00