Received: by 10.223.185.116 with SMTP id b49csp1786811wrg; Sun, 11 Feb 2018 21:26:54 -0800 (PST) X-Google-Smtp-Source: AH8x224IkpSG1BzzfbmuREVZjJ2Nf2TDDLdAZbuxapBwLHsvR/moBU7+BNagXRAC48PEyzAMnVqf X-Received: by 2002:a17:902:52f:: with SMTP id 44-v6mr9564722plf.65.1518413214508; Sun, 11 Feb 2018 21:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518413214; cv=none; d=google.com; s=arc-20160816; b=A62mM0/Cvt5KpxgkqDkyMLAPrz75pGFwWrAFEQHXA9ar9d9Nq4SApqdWXR4DH6JO5S ji+IjEFgsJBRzRiwEFXOEbG4eQU01fccUMBp+gFnSFEsg9xHjwU3/pggug+4QQ0bxeJl bVbtOrFNGtE86liOXLzhnX+3MdsdjrFjj20gq/1zzMYCqPUWIS8HJdfmeCLrRoALjzQw /637wHJxlnbbQxodBYsN55aUd+si21RE0cEnFJ2nQtiDt9VaGgI25y7zFjuGXGwgU0vT XjUegb0LXGhcwNr2JqEnjbJYGqheGp6jEzibQrJiOkDBWhOA83QTpN5S+GBlQWCNTYOK iNHA== 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=EfqwWC6h2XzDQddnLQYQse0Fsbl/O8Ggh78Wg+FPv2Y=; b=nogb2CaGeS667XTZZiCGcTBBc5Tbbzp4aZ7acBqGXEs83qE+u/mcgXEF954yspG5Tb lsN6mLLIeWds7w4BLjn3DfdHxVZFW7lepnoCj6NjYhMMV77xIJTKuvjSNV0eg0gODnCh 0RKqihxq7YNWpofReBJqT0w2DLIpizyPlLV9qZER3h3XZPnOmjOCXFCSLlizpsjnUQqJ DoPYM/WSBEBhZ/XUP/hMGKjMMLS8Y6B5ARj1F5m5Ey309TqSPNk59XXUSbpJ70MTYyv+ TjorU8Hzm1NdzJszEtZOeQlq5EqL4iWuVqxjIrxq8bibmcpB+Id+cvjRu8sSNcMSwp2x NG8Q== 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 r17si193979pge.478.2018.02.11.21.26.40; Sun, 11 Feb 2018 21:26:54 -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 S1751385AbeBLFYv (ORCPT + 99 others); Mon, 12 Feb 2018 00:24:51 -0500 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:30143 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751045AbeBLFWY (ORCPT ); Mon, 12 Feb 2018 00:22:24 -0500 Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id 3C05A60794; Mon, 12 Feb 2018 05:22:24 +0000 (UTC) Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 7850D6F; Mon, 12 Feb 2018 05:22:23 +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 15CD84A; Mon, 12 Feb 2018 05:22:23 +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 v2 03/11] watchdog/hpwdt: Update nmi_panic message. Date: Sun, 11 Feb 2018 22:21:03 -0700 Message-Id: <20180212052111.12010-4-jerry.hoemann@hpe.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180212052111.12010-1-jerry.hoemann@hpe.com> References: <20180212052111.12010-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 20a13c5d0285..6f7949ef9a23 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -108,24 +108,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