Now that the implementation of the HPET-based hardlockup detector is
complete, enable it. It will be used only if it can be initialized
successfully. Otherwise, the perf-based detector will be used.

Cc: Ashok Raj <ashok....@intel.com>
Cc: Andi Kleen <andi.kl...@intel.com>
Cc: Tony Luck <tony.l...@intel.com>
Cc: Borislav Petkov <b...@suse.de>
Cc: Jacob Pan <jacob.jun....@intel.com>
Cc: "Rafael J. Wysocki" <rafael.j.wyso...@intel.com>
Cc: Don Zickus <dzic...@redhat.com>
Cc: Nicholas Piggin <npig...@gmail.com>
Cc: Michael Ellerman <m...@ellerman.id.au>
Cc: Frederic Weisbecker <frede...@kernel.org>
Cc: Alexei Starovoitov <a...@kernel.org>
Cc: Babu Moger <babu.mo...@oracle.com>
Cc: Mathieu Desnoyers <mathieu.desnoy...@efficios.com>
Cc: Masami Hiramatsu <mhira...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Philippe Ombredanne <pombreda...@nexb.com>
Cc: Colin Ian King <colin.k...@canonical.com>
Cc: Byungchul Park <byungchul.p...@lge.com>
Cc: "Paul E. McKenney" <paul...@linux.vnet.ibm.com>
Cc: "Luis R. Rodriguez" <mcg...@kernel.org>
Cc: Waiman Long <long...@redhat.com>
Cc: Josh Poimboeuf <jpoim...@redhat.com>
Cc: Randy Dunlap <rdun...@infradead.org>
Cc: Davidlohr Bueso <d...@stgolabs.net>
Cc: Christoffer Dall <cd...@linaro.org>
Cc: Marc Zyngier <marc.zyng...@arm.com>
Cc: Kai-Heng Feng <kai.heng.f...@canonical.com>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: David Rientjes <rient...@google.com>
Cc: "Ravi V. Shankar" <ravi.v.shan...@intel.com>
Cc: x...@kernel.org
Cc: io...@lists.linux-foundation.org
Signed-off-by: Ricardo Neri <ricardo.neri-calde...@linux.intel.com>
---
 kernel/watchdog.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index b5ce6e4..e2cc6c0 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -149,6 +149,21 @@ int __weak __init watchdog_nmi_probe(void)
 {
        int ret = -ENODEV;
 
+       /*
+        * Try first with the HPET hardlockup detector. It will only
+        * succeed if selected at build time and the nmi_watchdog
+        * command-line parameter is configured. This ensure that the
+        * perf-based detector is used by default, if selected at
+        * build time.
+        */
+       if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR_HPET))
+               ret = hardlockup_detector_hpet_ops.init();
+
+       if (!ret) {
+               nmi_wd_ops = &hardlockup_detector_hpet_ops;
+               return ret;
+       }
+
        if (IS_ENABLED(CONFIG_HARDLOCKUP_DETECTOR_PERF))
                ret = hardlockup_detector_perf_ops.init();
 
-- 
2.7.4

Reply via email to