Received: by 10.223.176.5 with SMTP id f5csp1219511wra; Tue, 6 Feb 2018 15:05:20 -0800 (PST) X-Google-Smtp-Source: AH8x226aG2okbFEboJfSmXKWkeWXgifcFy3JEOCXhbiTpOdRFqOMsU0CJD8uHGP08SCFSeceLwpw X-Received: by 2002:a17:902:4003:: with SMTP id b3-v6mr3961824pld.154.1517958320859; Tue, 06 Feb 2018 15:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517958320; cv=none; d=google.com; s=arc-20160816; b=g5dyxCSWdH48OEugqjo9FlWGc+Ot0HXrQTOjtwtfg13Ahg8zx1l7QV2w1wJeFOGpvR uY+/ghpX9SZuL2Mezu2E9Of470pDQ31gDyMterRLaZIG/ULS00LEl9xjqQRSQpAWBOQD YygIPs+Bl8dyUld2dNga5SnmN5VszYTjWfZnnw3PBEJe9T1bV5BAcd5OaBW5wszQRQvb 3+MIjwONIUW7XwA3xzH2gXG0VFAyHwG336a3ZaajcNDjcjjo5fkj7tJcwxmFG9wwVpqs XCbFdI8745tB6h38r3zUaGW/9T3do3mh15LHvee32LzPL/WT0sS/vEu6nhz8MsxqCHah dRzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gCWtSWCaQHyN4XsH1Jup3SHZrCLvZZi06KWUrvxLH+0=; b=sSLJOGmz1oavcoTga+8D7fZev1EP6YoAUzwEtf8JoYfsCGaMC+p1TyjyO4OCWc/Rw9 xuZIdoPkq2jMWC5YxPVX3JU2KUeare8bgtiqjjYDtnrsqmt3n0fyLwV9fqFWaeCMumg2 Adj61p9BSPFPvh5dAEkioZL4qrgsYrW26bvhmd3Znch9a27IJGO+t4D6T875hwrZrS86 +73T7Q6dg8rZYFX91QuOHe/3XVadqE/jisFyLqZqIMO3JHSfHgqsalMWkBxOR+chBNQJ +V/91zA4DdHwyZdB7c6MQJ6+mW84zo1fwRJf/SM1bphqZ8+ek8ravYcqEmeUg3dRvOjT CPQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29si81697pfj.102.2018.02.06.15.05.07; Tue, 06 Feb 2018 15:05:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbeBFXCg (ORCPT + 99 others); Tue, 6 Feb 2018 18:02:36 -0500 Received: from g9t5009.houston.hpe.com ([15.241.48.73]:43922 "EHLO g9t5009.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753756AbeBFXAN (ORCPT ); Tue, 6 Feb 2018 18:00:13 -0500 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 6475C63; Tue, 6 Feb 2018 23:00:13 +0000 (UTC) Received: from anatevka.ftc.rdlabs.hpecorp.net (anatevka.americas.hpqcorp.net [10.34.81.6]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 0158052; Tue, 6 Feb 2018 23:00:12 +0000 (UTC) From: Jerry Hoemann To: wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, rwright@hpe.com, maurice.a.saldivar@hpe.com, Jerry Hoemann Subject: [PATCH 03/10] watchdog/hpwdt: Update nmi_panic message. Date: Tue, 6 Feb 2018 15:58:48 -0700 Message-Id: <20180206225855.30582-4-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180206225855.30582-1-jerry.hoemann@hpe.com> References: <20180206225855.30582-1-jerry.hoemann@hpe.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Include the nmistat in the nmi_panic message to give support an indication why the NMI was called (e.g. a timeout or generate nmi button.) Signed-off-by: Jerry Hoemann --- drivers/watchdog/hpwdt.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 260740051084..7f55b9bf371e 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -106,24 +106,35 @@ static int hpwdt_my_nmi(void) return ioread8(hpwdt_nmistat) & 0x6; } +static inline int hexdigit(int v) +{ + return (v > 9) ? (v-9+'A') : (v+'0'); +} + /* * NMI Handler */ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) { - if ((ulReason == NMI_UNKNOWN) && !hpwdt_my_nmi()) + unsigned int mynmi = hpwdt_my_nmi(); + static char panic_msg[] = + "00: An NMI occurred. Depending on your system the reason " + "for the NMI is logged in any one of the following resources:\n" + "1. Integrated Management Log (IML)\n" + "2. OA Syslog\n" + "3. OA Forward Progress Log\n" + "4. iLO Event Log"; + + if ((ulReason == NMI_UNKNOWN) && !mynmi) return NMI_DONE; if (allow_kdump) hpwdt_stop(); - nmi_panic(regs, "An NMI occurred. Depending on your system the reason " - "for the NMI is logged in any one of the following " - "resources:\n" - "1. Integrated Management Log (IML)\n" - "2. OA Syslog\n" - "3. OA Forward Progress Log\n" - "4. iLO Event Log"); + panic_msg[0] = hexdigit((mynmi>>4)&0xf); + panic_msg[1] = hexdigit(mynmi&0xf); + + nmi_panic(regs, panic_msg); return NMI_HANDLED; } -- 2.13.6