[PATCH 1/2] timer: tsc_timer: Fix FTRACE support

Patrick Rudolph patrick.rudolph at 9elements.com
Wed Dec 17 08:25:56 CET 2025


Currently FTRACE aborts on the first function call since getting the
timestamp causes a recursion and tracing is immediately disabled.

Fix that by adding 'notrace' to TSC timer functions.
TEST=The 'trace' cmd reports that functions have been traced on
     qemu-q35 when CONFIG_TRACE is enabled and FTRACE=1.

Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
---
 drivers/timer/tsc_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/timer/tsc_timer.c b/drivers/timer/tsc_timer.c
index dd16ab320b2..d17fb2337dc 100644
--- a/drivers/timer/tsc_timer.c
+++ b/drivers/timer/tsc_timer.c
@@ -395,14 +395,14 @@ void __udelay(unsigned long usec)
 #endif
 }
 
-static u64 tsc_timer_get_count(struct udevice *dev)
+static u64 notrace tsc_timer_get_count(struct udevice *dev)
 {
 	u64 now_tick = rdtsc();
 
 	return now_tick - gd->arch.tsc_base;
 }
 
-static void tsc_timer_ensure_setup(bool early)
+static void notrace tsc_timer_ensure_setup(bool early)
 {
 	if (gd->arch.tsc_inited)
 		return;
-- 
2.52.0



More information about the U-Boot mailing list