[PATCH 06/13] cobalt/clock: drop timer calibration

Philippe Gerum rpm at xenomai.org
Sun Jan 31 15:45:33 CET 2021


From: Philippe Gerum <rpm at xenomai.org>

The calibrated timer setup time is currently accounted for in the
timer gravity triplet (.user, also used as default .irq latency),
exclusively. This forces in a dynamically calculated parameter with no
way to override it. Meanwhile, this value would be already included in
every gravity value which autotune may determine, so this setting is
pretty much redundant.

Drop nktimerlat and the requirement for the machine section to provide
a timer calibration handler, we don't need these.

Signed-off-by: Philippe Gerum <rpm at xenomai.org>
---
 include/cobalt/kernel/clock.h                  | 2 --
 include/cobalt/kernel/ipipe/pipeline/machine.h | 6 ------
 kernel/cobalt/clock.c                          | 7 -------
 3 files changed, 15 deletions(-)

diff --git a/include/cobalt/kernel/clock.h b/include/cobalt/kernel/clock.h
index 59835951c..bbf34c53c 100644
--- a/include/cobalt/kernel/clock.h
+++ b/include/cobalt/kernel/clock.h
@@ -104,8 +104,6 @@ struct xnclock_ratelimit_state {
 
 extern struct xnclock nkclock;
 
-extern unsigned long nktimerlat;
-
 int xnclock_register(struct xnclock *clock,
 		     const cpumask_t *affinity);
 
diff --git a/include/cobalt/kernel/ipipe/pipeline/machine.h b/include/cobalt/kernel/ipipe/pipeline/machine.h
index 32d5cd2a2..a5a5197e9 100644
--- a/include/cobalt/kernel/ipipe/pipeline/machine.h
+++ b/include/cobalt/kernel/ipipe/pipeline/machine.h
@@ -24,7 +24,6 @@ struct cobalt_machine {
 	int (*late_init)(void);
 	void (*cleanup)(void);
 	void (*prefault)(struct vm_area_struct *vma);
-	unsigned long (*calibrate)(void);
 	const char *const *fault_labels;
 };
 
@@ -46,11 +45,6 @@ struct cobalt_pipeline {
 #endif
 };
 
-static inline unsigned long xnarch_timer_calibrate(void)
-{
-	return cobalt_machine.calibrate();
-}
-
 int pipeline_init(void);
 
 int pipeline_late_init(void);
diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c
index 7d1e00ea1..bf24e1693 100644
--- a/kernel/cobalt/clock.c
+++ b/kernel/cobalt/clock.c
@@ -32,7 +32,6 @@
  *
  * @{
  */
-unsigned long nktimerlat;
 
 #ifdef XNARCH_HAVE_NODIV_LLIMD
 
@@ -456,8 +455,6 @@ void print_core_clock_status(struct xnclock *clock,
 	xnvfile_printf(it, "%8s: timer=%s, clock=%s\n",
 		       "devices", pipeline_timer_name(), pipeline_clock_name());
 	xnvfile_printf(it, "%8s: %s\n", "watchdog", wd_status);
-	xnvfile_printf(it, "%8s: %Lu\n", "setup",
-		       xnclock_ticks_to_ns(&nkclock, nktimerlat));
 }
 
 static int clock_show(struct xnvfile_regular_iterator *it, void *data)
@@ -784,11 +781,8 @@ static void reset_core_clock_gravity(struct xnclock *clock)
 	struct xnclock_gravity gravity;
 
 	xnarch_get_latencies(&gravity);
-	gravity.user += nktimerlat;
 	if (gravity.kernel == 0)
 		gravity.kernel = gravity.user;
-	if (gravity.irq == 0)
-		gravity.irq = nktimerlat;
 	set_core_clock_gravity(clock, &gravity);
 }
 
@@ -817,7 +811,6 @@ int __init xnclock_init()
 	xnarch_init_u32frac(&bln_frac, 1, 1000000000);
 #endif
 	pipeline_init_clock();
-	nktimerlat = xnarch_timer_calibrate();
 	xnclock_reset_gravity(&nkclock);
 	xnclock_register(&nkclock, &xnsched_realtime_cpus);
 
-- 
2.26.2




More information about the Xenomai mailing list