Skip to content

Commit

Permalink
parisc: Mark cr16 clock unstable on all SMP machines
Browse files Browse the repository at this point in the history
The cr16 interval timers are not synchronized across CPUs, even with just
one dual-core CPU. This becomes visible if the machines have a longer
uptime.

Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
Helge Deller committed May 8, 2022
1 parent a65bcad commit 340233d
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions arch/parisc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,33 +251,14 @@ void __init time_init(void)
static int __init init_cr16_clocksource(void)
{
/*
* The cr16 interval timers are not syncronized across CPUs on
* different sockets, so mark them unstable and lower rating on
* multi-socket SMP systems.
* The cr16 interval timers are not synchronized across CPUs.
*/
if (num_online_cpus() > 1 && !running_on_qemu) {
int cpu;
unsigned long cpu0_loc;
cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;

for_each_online_cpu(cpu) {
if (cpu == 0)
continue;
if ((cpu0_loc != 0) &&
(cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
continue;

clocksource_cr16.name = "cr16_unstable";
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
clocksource_cr16.rating = 0;
break;
}
clocksource_cr16.name = "cr16_unstable";
clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
clocksource_cr16.rating = 0;
}

/* 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);
Expand Down

0 comments on commit 340233d

Please sign in to comment.