Skip to content

Commit 9dc4241

Browse files
committed
Revert "parisc: Mark cr16 CPU clocksource unstable on all SMP machines"
This reverts commit afdb4a5. It triggers RCU stalls at boot with a 32-bit kernel. Signed-off-by: Helge Deller <deller@gmx.de> Noticed-by: John David Anglin <dave.anglin@bell.net> Cc: stable@vger.kernel.org # v5.16+
1 parent 30c8e80 commit 9dc4241

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

arch/parisc/kernel/time.c

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

266280
/* register at clocksource framework */

0 commit comments

Comments
 (0)