From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbdINKrX (ORCPT ); Thu, 14 Sep 2017 06:47:23 -0400 Received: from terminus.zytor.com ([65.50.211.136]:48137 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880AbdINKqg (ORCPT ); Thu, 14 Sep 2017 06:46:36 -0400 Date: Thu, 14 Sep 2017 03:40:46 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: npiggin@gmail.com, torvalds@linux-foundation.org, dzickus@redhat.com, akpm@linux-foundation.org, bigeasy@linutronix.de, peterz@infradead.org, uobergfe@redhat.com, deller@gmx.de, linux-kernel@vger.kernel.org, bp@alien8.de, hpa@zytor.com, tglx@linutronix.de, cmetcalf@mellanox.com, mingo@kernel.org Reply-To: peterz@infradead.org, uobergfe@redhat.com, deller@gmx.de, akpm@linux-foundation.org, bigeasy@linutronix.de, dzickus@redhat.com, npiggin@gmail.com, torvalds@linux-foundation.org, mingo@kernel.org, cmetcalf@mellanox.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, bp@alien8.de, hpa@zytor.com In-Reply-To: <20170912194146.327343752@linutronix.de> References: <20170912194146.327343752@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] watchdog/core: Provide interface to stop from poweroff() Git-Commit-ID: 6554fd8cf06db86f861bb24d7487b2873ca444c4 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 Commit-ID: 6554fd8cf06db86f861bb24d7487b2873ca444c4 Gitweb: http://git.kernel.org/tip/6554fd8cf06db86f861bb24d7487b2873ca444c4 Author: Thomas Gleixner AuthorDate: Tue, 12 Sep 2017 21:36:57 +0200 Committer: Ingo Molnar CommitDate: Thu, 14 Sep 2017 11:41:03 +0200 watchdog/core: Provide interface to stop from poweroff() PARISC has a a busy looping power off routine. If the watchdog is enabled the watchdog timer will still fire, but the thread is not running, which causes the softlockup watchdog to trigger. Provide a interface which allows to turn the watchdog off. Signed-off-by: Thomas Gleixner Reviewed-by: Don Zickus Cc: Andrew Morton Cc: Borislav Petkov Cc: Chris Metcalf Cc: Helge Deller Cc: Linus Torvalds Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Sebastian Siewior Cc: Ulrich Obergfell Cc: linux-parisc@vger.kernel.org Link: http://lkml.kernel.org/r/20170912194146.327343752@linutronix.de Signed-off-by: Ingo Molnar --- include/linux/nmi.h | 6 +++--- kernel/watchdog.c | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index b24d4a5..85bb268b 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -12,10 +12,10 @@ #ifdef CONFIG_LOCKUP_DETECTOR void lockup_detector_init(void); +void lockup_detector_soft_poweroff(void); #else -static inline void lockup_detector_init(void) -{ -} +static inline void lockup_detector_init(void) { } +static inline void lockup_detector_soft_poweroff(void) { } #endif #ifdef CONFIG_SOFTLOCKUP_DETECTOR diff --git a/kernel/watchdog.c b/kernel/watchdog.c index f5d5202..f23e373 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) int duration; int softlockup_all_cpu_backtrace = sysctl_softlockup_all_cpu_backtrace; - if (atomic_read(&watchdog_park_in_progress) != 0) + if (!watchdog_enabled || + atomic_read(&watchdog_park_in_progress) != 0) return HRTIMER_NORESTART; /* kick the hardlockup detector */ @@ -660,6 +661,17 @@ static void set_sample_period(void) } #endif /* SOFTLOCKUP */ +/** + * lockup_detector_soft_poweroff - Interface to stop lockup detector(s) + * + * Special interface for parisc. It prevents lockup detector warnings from + * the default pm_poweroff() function which busy loops forever. + */ +void lockup_detector_soft_poweroff(void) +{ + watchdog_enabled = 0; +} + /* * Suspend the hard and soft lockup detector by parking the watchdog threads. */