Skip to content

Commit afdb4a5

Browse files
committed
parisc: Mark cr16 CPU clocksource unstable on all SMP machines
In commit c8c3735 ("parisc: Enhance detection of synchronous cr16 clocksources") I assumed that CPUs on the same physical core are syncronous. While booting up the kernel on two different C8000 machines, one with a dual-core PA8800 and one with a dual-core PA8900 CPU, this turned out to be wrong. The symptom was that I saw a jump in the internal clocks printed to the syslog and strange overall behaviour. On machines which have 4 cores (2 dual-cores) the problem isn't visible, because the current logic already marked the cr16 clocksource unstable in this case. This patch now marks the cr16 interval timers unstable if we have more than one CPU in the system, and it fixes this issue. Fixes: c8c3735 ("parisc: Enhance detection of synchronous cr16 clocksources") Signed-off-by: Helge Deller <[email protected]> Cc: <[email protected]> # v5.15+
1 parent 0f9fee4 commit afdb4a5

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

arch/parisc/kernel/time.c

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -249,30 +249,16 @@ void __init time_init(void)
249249
static int __init init_cr16_clocksource(void)
250250
{
251251
/*
252-
* The cr16 interval timers are not syncronized across CPUs on
253-
* different sockets, so mark them unstable and lower rating on
254-
* multi-socket SMP systems.
252+
* The cr16 interval timers are not syncronized across CPUs, even if
253+
* they share the same socket.
255254
*/
256255
if (num_online_cpus() > 1 && !running_on_qemu) {
257-
int cpu;
258-
unsigned long cpu0_loc;
259-
cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;
260-
261-
for_each_online_cpu(cpu) {
262-
if (cpu == 0)
263-
continue;
264-
if ((cpu0_loc != 0) &&
265-
(cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
266-
continue;
267-
268-
/* mark sched_clock unstable */
269-
clear_sched_clock_stable();
270-
271-
clocksource_cr16.name = "cr16_unstable";
272-
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
273-
clocksource_cr16.rating = 0;
274-
break;
275-
}
256+
/* mark sched_clock unstable */
257+
clear_sched_clock_stable();
258+
259+
clocksource_cr16.name = "cr16_unstable";
260+
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
261+
clocksource_cr16.rating = 0;
276262
}
277263

278264
/* register at clocksource framework */

0 commit comments

Comments
 (0)