]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
parisc: Use cr16 interval timers unconditionally on qemu
authorHelge Deller <deller@gmx.de>
Fri, 12 Jan 2018 21:44:00 +0000 (22:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2019 06:36:47 +0000 (08:36 +0200)
commit 5ffa8518851f1401817c15d2a7eecc0373c26ff9 upstream.

When running on qemu we know that the (emulated) cr16 cpu-internal
clocks are syncronized. So let's use them unconditionally on qemu.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # 4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/parisc/include/asm/processor.h
arch/parisc/kernel/time.c

index 2e674e13e005420b15beb9b945e2d88c850937f0..656984ec195896a4ab5d94c0c5b3081c9f6363d6 100644 (file)
@@ -323,6 +323,8 @@ extern int _parisc_requires_coherency;
 #define parisc_requires_coherency()    (0)
 #endif
 
+extern int running_on_qemu;
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ASM_PARISC_PROCESSOR_H */
index 47ef8fdcd382cb5616f6375ecedf13a1fb4ea251..22754e0c3bda506758f118ed2a96a9185c18fc0a 100644 (file)
@@ -299,7 +299,7 @@ static int __init init_cr16_clocksource(void)
         * The cr16 interval timers are not syncronized across CPUs, so mark
         * them unstable and lower rating on SMP systems.
         */
-       if (num_online_cpus() > 1) {
+       if (num_online_cpus() > 1 && !running_on_qemu) {
                clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
                clocksource_cr16.rating = 0;
        }