IOTM: timer will only be created once [1/1]
PD#SWPL-198946
Problem:
After resume, the timer is created multiple times
due to the reinitialization of the IOTM.
Solution:
The timer will only be created once.
Verify:
t6d
Change-Id: Ie4c6b20f4c06ee72e558c77d1df115897a255811
Signed-off-by: qiankun.wang <qiankun.wang@amlogic.com>
diff --git a/drivers/debug/aml_iotm.c b/drivers/debug/aml_iotm.c
index 6d47d21..6003b90 100644
--- a/drivers/debug/aml_iotm.c
+++ b/drivers/debug/aml_iotm.c
@@ -705,9 +705,6 @@
writel(val, iotm.cssys_base + IOTM_CTRL_MODE);
}
- timer_setup(&iotm.ts_to_kernel_timer, get_boot_time, 0);
- mod_timer(&iotm.ts_to_kernel_timer, jiffies + msecs_to_jiffies(1));
-
/* enable iotm */
val = readl(iotm.cssys_base + IOTM_CTRL_MODE);
@@ -1000,6 +997,10 @@
return ret;
}
+ /* create timer to record kernel_time and iotm timestamp */
+ timer_setup(&iotm.ts_to_kernel_timer, get_boot_time, 0);
+ mod_timer(&iotm.ts_to_kernel_timer, jiffies + msecs_to_jiffies(1));
+
/* print iotm trace */
atomic_notifier_chain_register(&panic_notifier_list, &iotm_panic_notifier);