Skip to content

Commit 6554fd8

Browse files
KAGA-KOKOingomolnar
authored andcommitted
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 <tglx@linutronix.de> Reviewed-by: Don 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.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 2406e3b commit 6554fd8

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎include/linux/nmi.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
#ifdef CONFIG_LOCKUP_DETECTOR
1414
void lockup_detector_init(void);
15+
void lockup_detector_soft_poweroff(void);
1516
#else
16-
static inline void lockup_detector_init(void)
17-
{
18-
}
17+
static inline void lockup_detector_init(void) { }
18+
static inline void lockup_detector_soft_poweroff(void) { }
1919
#endif
2020

2121
#ifdef CONFIG_SOFTLOCKUP_DETECTOR

‎kernel/watchdog.c‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
333333
int duration;
334334
int softlockup_all_cpu_backtrace = sysctl_softlockup_all_cpu_backtrace;
335335

336-
if (atomic_read(&watchdog_park_in_progress) != 0)
336+
if (!watchdog_enabled ||
337+
atomic_read(&watchdog_park_in_progress) != 0)
337338
return HRTIMER_NORESTART;
338339

339340
/* kick the hardlockup detector */
@@ -660,6 +661,17 @@ static void set_sample_period(void)
660661
}
661662
#endif /* SOFTLOCKUP */
662663

664+
/**
665+
* lockup_detector_soft_poweroff - Interface to stop lockup detector(s)
666+
*
667+
* Special interface for parisc. It prevents lockup detector warnings from
668+
* the default pm_poweroff() function which busy loops forever.
669+
*/
670+
void lockup_detector_soft_poweroff(void)
671+
{
672+
watchdog_enabled = 0;
673+
}
674+
663675
/*
664676
* Suspend the hard and soft lockup detector by parking the watchdog threads.
665677
*/

0 commit comments

Comments
 (0)