Commit 6554fd8c authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

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: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarDon Zickus <dzickus@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Ulrich Obergfell <uobergfe@redhat.com>
Cc: linux-parisc@vger.kernel.org
Link: http://lkml.kernel.org/r/20170912194146.327343752@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 2406e3b1
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
#ifdef CONFIG_LOCKUP_DETECTOR #ifdef CONFIG_LOCKUP_DETECTOR
void lockup_detector_init(void); void lockup_detector_init(void);
void lockup_detector_soft_poweroff(void);
#else #else
static inline void lockup_detector_init(void) static inline void lockup_detector_init(void) { }
{ static inline void lockup_detector_soft_poweroff(void) { }
}
#endif #endif
#ifdef CONFIG_SOFTLOCKUP_DETECTOR #ifdef CONFIG_SOFTLOCKUP_DETECTOR
......
...@@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) ...@@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
int duration; int duration;
int softlockup_all_cpu_backtrace = sysctl_softlockup_all_cpu_backtrace; 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; return HRTIMER_NORESTART;
/* kick the hardlockup detector */ /* kick the hardlockup detector */
...@@ -660,6 +661,17 @@ static void set_sample_period(void) ...@@ -660,6 +661,17 @@ static void set_sample_period(void)
} }
#endif /* SOFTLOCKUP */ #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. * Suspend the hard and soft lockup detector by parking the watchdog threads.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment