[PATCH 2/3] x86: touch clocksource watchdog after syncing TSCs

From: Muhammad Usama Anjum
Date: Mon Aug 08 2022 - 07:40:34 EST


From: Steven Noonan <steven@xxxxxxxxxxxxxx>

Update watchdog after syncing the TSCs of all the CPUs. This is needed
to avoid getting TSC clocksource marked as unstable after syncing them.

Signed-off-by: Steven Noonan <steven@xxxxxxxxxxxxxx>
Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx>
---
arch/x86/kernel/smpboot.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f24227bc3220..4b3a03004a1f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -56,6 +56,7 @@
#include <linux/numa.h>
#include <linux/pgtable.h>
#include <linux/overflow.h>
+#include <linux/clocksource.h>

#include <asm/acpi.h>
#include <asm/desc.h>
@@ -1444,6 +1445,7 @@ void arch_thaw_secondary_cpus_begin(void)

void arch_thaw_secondary_cpus_end(void)
{
+ clocksource_touch_watchdog();
mtrr_aps_init();
}

@@ -1477,6 +1479,8 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
{
pr_debug("Boot done\n");

+ clocksource_touch_watchdog();
+
calculate_max_logical_packages();

/* XXX for now assume numa-in-package and hybrid don't overlap */
--
2.30.2