Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753892AbbDBSpH (ORCPT ); Thu, 2 Apr 2015 14:45:07 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37272 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752804AbbDBSpE (ORCPT ); Thu, 2 Apr 2015 14:45:04 -0400 Date: Thu, 2 Apr 2015 11:44:30 -0700 From: tip-bot for Stephane Eranian Message-ID: Cc: tglx@linutronix.de, hpa@zytor.com, akpm@linux-foundation.org, mingo@kernel.org, fweisbec@gmail.com, peterz@infradead.org, dzickus@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org Reply-To: dzickus@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, fweisbec@gmail.com, akpm@linux-foundation.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <1416251225-17721-12-git-send-email-eranian@google.com> References: <1416251225-17721-12-git-send-email-eranian@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] watchdog: Add watchdog enable/ disable all functions Git-Commit-ID: b3738d29323344da3017a91010530cf3a58590fc X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2993 Lines: 95 Commit-ID: b3738d29323344da3017a91010530cf3a58590fc Gitweb: http://git.kernel.org/tip/b3738d29323344da3017a91010530cf3a58590fc Author: Stephane Eranian AuthorDate: Mon, 17 Nov 2014 20:07:03 +0100 Committer: Ingo Molnar CommitDate: Thu, 2 Apr 2015 17:33:15 +0200 watchdog: Add watchdog enable/disable all functions This patch adds two new functions to enable/disable the watchdog across all CPUs. This will be used by the HT PMU bug workaround code to disable/enable the NMI watchdog across quirk enablement. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Cc: bp@alien8.de Cc: jolsa@redhat.com Cc: kan.liang@intel.com Cc: maria.n.dimakopoulou@gmail.com Cc: Frederic Weisbecker Cc: Don Zickus Cc: Andrew Morton Link: http://lkml.kernel.org/r/1416251225-17721-12-git-send-email-eranian@google.com Signed-off-by: Ingo Molnar --- include/linux/watchdog.h | 8 ++++++++ kernel/watchdog.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 395b70e..a746bf5 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h @@ -137,4 +137,12 @@ extern int watchdog_init_timeout(struct watchdog_device *wdd, extern int watchdog_register_device(struct watchdog_device *); extern void watchdog_unregister_device(struct watchdog_device *); +#ifdef CONFIG_HARDLOCKUP_DETECTOR +void watchdog_nmi_disable_all(void); +void watchdog_nmi_enable_all(void); +#else +static inline void watchdog_nmi_disable_all(void) {} +static inline void watchdog_nmi_enable_all(void) {} +#endif + #endif /* ifndef _LINUX_WATCHDOG_H */ diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 3174bf8..9a056f5 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -567,9 +567,37 @@ static void watchdog_nmi_disable(unsigned int cpu) cpu0_err = 0; } } + +void watchdog_nmi_enable_all(void) +{ + int cpu; + + if (!watchdog_user_enabled) + return; + + get_online_cpus(); + for_each_online_cpu(cpu) + watchdog_nmi_enable(cpu); + put_online_cpus(); +} + +void watchdog_nmi_disable_all(void) +{ + int cpu; + + if (!watchdog_running) + return; + + get_online_cpus(); + for_each_online_cpu(cpu) + watchdog_nmi_disable(cpu); + put_online_cpus(); +} #else static int watchdog_nmi_enable(unsigned int cpu) { return 0; } static void watchdog_nmi_disable(unsigned int cpu) { return; } +void watchdog_nmi_enable_all(void) {} +void watchdog_nmi_disable_all(void) {} #endif /* CONFIG_HARDLOCKUP_DETECTOR */ static struct smp_hotplug_thread watchdog_threads = { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/