Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754826AbcCBKmc (ORCPT ); Wed, 2 Mar 2016 05:42:32 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:37457 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbcCBKm0 (ORCPT ); Wed, 2 Mar 2016 05:42:26 -0500 X-AuditID: 85900ec0-9e1cab9000001a57-e1-56d6c2e88cb5 X-Mailbox-Line: From nobody Wed Mar 2 19:36:31 2016 Subject: [v2 PATCH 2/3] ipmi/watchdog: Use nmi_panic() when kernel panics in NMI handler To: Andrew Morton , Thomas Mingarelli , Wim Van Sebroeck , Corey Minyard From: Hidehiro Kawai Cc: Corey Minyard , Michal Hocko , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Borislav Petkov , openipmi-developer@lists.sourceforge.net, Guenter Roeck Date: Wed, 02 Mar 2016 19:36:29 +0900 Message-ID: <20160302103629.5058.60500.stgit@softrs> In-Reply-To: <20160302103624.5058.35844.stgit@softrs> References: <20160302103624.5058.35844.stgit@softrs> User-Agent: StGit/0.16 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1233 Lines: 32 commit 1717f2096b54 ("panic, x86: Fix re-entrance problem due to panic on NMI") introduced nmi_panic() which prevents concurrent and recursive execution of panic(). It also saves registers for the crash dump on x86 by later commit 58c5661f2144 ("panic, x86: Allow CPUs to save registers even if looping in NMI context"). ipmi_watchdog driver can call panic() from NMI handler, so replace it with nmi_panic(). Signed-off-by: Hidehiro Kawai Acked-by: Corey Minyard Acked-by: Guenter Roeck Reviewed-by: Michal Hocko Cc: openipmi-developer@lists.sourceforge.net --- drivers/char/ipmi/ipmi_watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 096f0ce..4facc75 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -1140,7 +1140,7 @@ ipmi_nmi(unsigned int val, struct pt_regs *regs) the timer. So do so. */ pretimeout_since_last_heartbeat = 1; if (atomic_inc_and_test(&preop_panic_excl)) - panic(PFX "pre-timeout"); + nmi_panic(regs, PFX "pre-timeout"); } return NMI_HANDLED;