Skip to contentSkip to conversation

parisc: Mark sched_clock unstable only if clocks are not syncronized

PATCH New Helge Deller 1 participant 1 message Sep 8, 2021 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Mark sched_clock unstable only if clocks are not syncronized

We check at runtime if the cr16 clocks are stable across CPUs. Only mark the sched_clock unstable by calling clear_sched_clock_stable() if we know that we run on a system which isn't syncronized across CPUs.

---
 arch/parisc/kernel/setup.c | 2 --
 arch/parisc/kernel/time.c  | 7 +++----
 2 files changed, 3 insertions(+), 6 deletions(-)
arch/parisc/kernel/setup.c +0 -2
index 3fb86ee507dd..cceb09855e03 100644
@@ -150,8 +150,6 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_PA11
 	dma_ops_init();
 #endif
-
-	clear_sched_clock_stable();
 }
 
 /*
arch/parisc/kernel/time.c +3 -4
index 08e4d480abe1..9fb1e794831b 100644
@@ -265,6 +265,9 @@ static int __init init_cr16_clocksource(void)
 			    (cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
 				continue;
 
+			/* mark sched_clock unstable */
+			clear_sched_clock_stable();
+
 			clocksource_cr16.name = "cr16_unstable";
 			clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
 			clocksource_cr16.rating = 0;
@@ -272,10 +275,6 @@ static int __init init_cr16_clocksource(void)
 		}
 	}
 
-	/* XXX: We may want to mark sched_clock stable here if cr16 clocks are
-	 *	in sync:
-	 *	(clocksource_cr16.flags == CLOCK_SOURCE_IS_CONTINUOUS) */
-
 	/* register at clocksource framework */
 	clocksource_register_hz(&clocksource_cr16,
 		100 * PAGE0->mem_10msec);

--
2.31.1