From: Thomas Gleixner <tglx@linutronix.de> To: LKML <linux-kernel@vger.kernel.org> Cc: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Borislav Petkov <bp@alien8.de>, Sebastian Siewior <bigeasy@linutronix.de>, Nicholas Piggin <npiggin@gmail.com>, Don Zickus <dzickus@redhat.com>, Chris Metcalf <cmetcalf@mellanox.com>, Ulrich Obergfell <uobergfe@redhat.com>, Helge Deller <deller@gmx.de>, linux-parisc@vger.kernel.org Subject: [patch 03/29] lockup_detector: Provide interface to stop from poweroff() Date: Thu, 31 Aug 2017 09:16:01 +0200 Message-ID: <20170831073053.202164272@linutronix.de> (raw) In-Reply-To: <20170831071558.995235362@linutronix.de> 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> Cc: Helge Deller <deller@gmx.de> Cc: linux-parisc@vger.kernel.org --- include/linux/nmi.h | 6 +++--- kernel/watchdog.c | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) --- 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 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -333,7 +333,8 @@ static enum hrtimer_restart watchdog_tim 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. */
next parent reply index Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20170831071558.995235362@linutronix.de> 2017-08-31 7:16 ` Thomas Gleixner [this message] 2017-08-31 7:16 ` [patch 04/29] parisc: Use lockup_detector_stop() Thomas Gleixner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170831073053.202164272@linutronix.de \ --to=tglx@linutronix.de \ --cc=akpm@linux-foundation.org \ --cc=bigeasy@linutronix.de \ --cc=bp@alien8.de \ --cc=cmetcalf@mellanox.com \ --cc=deller@gmx.de \ --cc=dzickus@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-parisc@vger.kernel.org \ --cc=mingo@kernel.org \ --cc=npiggin@gmail.com \ --cc=peterz@infradead.org \ --cc=uobergfe@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-parisc Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-parisc/0 linux-parisc/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-parisc linux-parisc/ https://lore.kernel.org/linux-parisc \ linux-parisc@vger.kernel.org public-inbox-index linux-parisc Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.kernel.vger.linux-parisc AGPL code for this site: git clone https://public-inbox.org/public-inbox.git