public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Refine hpwdt message for UV platform
@ 2026-03-16 21:45 Steve Wahl
  2026-03-17 18:38 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Steve Wahl @ 2026-03-16 21:45 UTC (permalink / raw)
  To: Steve Wahl, Craig Lamparter, Wim Van Sebroeck, Guenter Roeck,
	linux-watchdog, linux-kernel
  Cc: Russ Anderson, Dimitri Sivanich, Kyle Meyer, Keng-Yu Lin, Collins,
	Steve

The watchdog hardware the hpwdt driver uses was added to the UV
platform for UV5, but the logging mentioned by this driver was not
added to the BIOS.  When the watchdog fires, the printed message had
the administrators and developers looking for non-existent log files,
and confused about whether a watchdog actually tripped.

Change the message that prints on UV platforms so it doesn't send the
user looking for non-existent logs.

To aid in any future debugging, include all 8 bits of the NMISTAT
register in the output, not just the two bits being used to determine
this was "mynmi".  And provide names to the bits in NMISTAT so the
code is easier to understand.

Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
---
 drivers/watchdog/hpwdt.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index ae30e394d176..be5d8cbd0818 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -24,6 +24,7 @@
 #include <asm/nmi.h>
 #endif
 #include <linux/crash_dump.h>
+#include <asm/uv/uv.h>
 
 #define HPWDT_VERSION			"2.0.4"
 #define SECS_TO_TICKS(secs)		((secs) * 1000 / 128)
@@ -158,9 +159,21 @@ static int hpwdt_set_pretimeout(struct watchdog_device *wdd, unsigned int req)
 	return 0;
 }
 
-static int hpwdt_my_nmi(void)
+#define NMISTAT_EASR	BIT(0)
+#define NMISTAT_EWDOG	BIT(1)
+#define NMISTAT_RTRAP	BIT(2)
+#define NMISTAT_DBELL	BIT(3)
+#define NMISTAT_EMSWDG	BIT(4)
+#define NMISTAT_GPI	BIT(5)
+#define NMISTAT_NMIOUT	BIT(7)
+
+static bool hpwdt_my_nmi(u8 *nmistat)
 {
-	return ioread8(hpwdt_nmistat) & 0x6;
+	u8 val = ioread8(hpwdt_nmistat);
+
+	if (nmistat)
+		*nmistat = val;
+	return (val & (NMISTAT_EWDOG | NMISTAT_RTRAP)) != 0;
 }
 
 /*
@@ -168,14 +181,18 @@ static int hpwdt_my_nmi(void)
  */
 static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
 {
-	unsigned int mynmi = hpwdt_my_nmi();
-	static char panic_msg[] =
+	u8 nmistat;
+	bool mynmi = hpwdt_my_nmi(&nmistat);
+	static char panic_msg_default[] =
 		"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";
+	static char panic_msg_uv[] =
+		"00: A watchdog NMI occurred.";
+	char *panic_msg = is_uv_system() ? panic_msg_uv : panic_msg_default;
 
 	if (ulReason == NMI_UNKNOWN && !mynmi)
 		return NMI_DONE;
@@ -189,7 +206,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
 		hpwdt_ping_ticks(SECS_TO_TICKS(val));
 	}
 
-	hex_byte_pack(panic_msg, mynmi);
+	hex_byte_pack(panic_msg, nmistat);
 	nmi_panic(regs, panic_msg);
 
 	return NMI_HANDLED;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Refine hpwdt message for UV platform
  2026-03-16 21:45 [PATCH] Refine hpwdt message for UV platform Steve Wahl
@ 2026-03-17 18:38 ` Guenter Roeck
  2026-03-17 18:39 ` Guenter Roeck
  2026-04-07 20:33 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-03-17 18:38 UTC (permalink / raw)
  To: Steve Wahl, Craig Lamparter, Wim Van Sebroeck, linux-watchdog,
	linux-kernel
  Cc: Russ Anderson, Dimitri Sivanich, Kyle Meyer, Keng-Yu Lin, Collins,
	Steve

On 3/16/26 14:45, Steve Wahl wrote:
> The watchdog hardware the hpwdt driver uses was added to the UV
> platform for UV5, but the logging mentioned by this driver was not
> added to the BIOS.  When the watchdog fires, the printed message had
> the administrators and developers looking for non-existent log files,
> and confused about whether a watchdog actually tripped.
> 
> Change the message that prints on UV platforms so it doesn't send the
> user looking for non-existent logs.
> 
> To aid in any future debugging, include all 8 bits of the NMISTAT
> register in the output, not just the two bits being used to determine
> this was "mynmi".  And provide names to the bits in NMISTAT so the
> code is easier to understand.
> 
> Signed-off-by: Steve Wahl <steve.wahl@hpe.com>
> ---
>   drivers/watchdog/hpwdt.c | 27 ++++++++++++++++++++++-----
>   1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index ae30e394d176..be5d8cbd0818 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -24,6 +24,7 @@
>   #include <asm/nmi.h>
>   #endif
>   #include <linux/crash_dump.h>
> +#include <asm/uv/uv.h>
>   
>   #define HPWDT_VERSION			"2.0.4"
>   #define SECS_TO_TICKS(secs)		((secs) * 1000 / 128)
> @@ -158,9 +159,21 @@ static int hpwdt_set_pretimeout(struct watchdog_device *wdd, unsigned int req)
>   	return 0;
>   }
>   
> -static int hpwdt_my_nmi(void)
> +#define NMISTAT_EASR	BIT(0)
> +#define NMISTAT_EWDOG	BIT(1)
> +#define NMISTAT_RTRAP	BIT(2)
> +#define NMISTAT_DBELL	BIT(3)
> +#define NMISTAT_EMSWDG	BIT(4)
> +#define NMISTAT_GPI	BIT(5)
> +#define NMISTAT_NMIOUT	BIT(7)
> +
> +static bool hpwdt_my_nmi(u8 *nmistat)
>   {
> -	return ioread8(hpwdt_nmistat) & 0x6;
> +	u8 val = ioread8(hpwdt_nmistat);
> +
> +	if (nmistat)
> +		*nmistat = val;

What is the point of this NULL check ? The parameter is never NULL.

> +	return (val & (NMISTAT_EWDOG | NMISTAT_RTRAP)) != 0;

I am not sure if it adds any value to do this check here instead of just
returning nmistat and checking in the calling code. Seems to me this just
adds unnecessary complexity to the code.

Guenter

>   }
>   
>   /*
> @@ -168,14 +181,18 @@ static int hpwdt_my_nmi(void)
>    */
>   static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
>   {
> -	unsigned int mynmi = hpwdt_my_nmi();
> -	static char panic_msg[] =
> +	u8 nmistat;
> +	bool mynmi = hpwdt_my_nmi(&nmistat);
> +	static char panic_msg_default[] =
>   		"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";
> +	static char panic_msg_uv[] =
> +		"00: A watchdog NMI occurred.";
> +	char *panic_msg = is_uv_system() ? panic_msg_uv : panic_msg_default;
>   
>   	if (ulReason == NMI_UNKNOWN && !mynmi)
>   		return NMI_DONE;
> @@ -189,7 +206,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
>   		hpwdt_ping_ticks(SECS_TO_TICKS(val));
>   	}
>   
> -	hex_byte_pack(panic_msg, mynmi);
> +	hex_byte_pack(panic_msg, nmistat);
>   	nmi_panic(regs, panic_msg);
>   
>   	return NMI_HANDLED;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Refine hpwdt message for UV platform
  2026-03-16 21:45 [PATCH] Refine hpwdt message for UV platform Steve Wahl
  2026-03-17 18:38 ` Guenter Roeck
@ 2026-03-17 18:39 ` Guenter Roeck
  2026-04-07 20:33 ` kernel test robot
  2 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2026-03-17 18:39 UTC (permalink / raw)
  To: Steve Wahl, Craig Lamparter, Wim Van Sebroeck, linux-watchdog,
	linux-kernel
  Cc: Russ Anderson, Dimitri Sivanich, Kyle Meyer, Keng-Yu Lin, Collins,
	Steve

On 3/16/26 14:45, Steve Wahl wrote:
> The watchdog hardware the hpwdt driver uses was added to the UV
> platform for UV5, but the logging mentioned by this driver was not
> added to the BIOS.  When the watchdog fires, the printed message had
> the administrators and developers looking for non-existent log files,
> and confused about whether a watchdog actually tripped.
> 
> Change the message that prints on UV platforms so it doesn't send the
> user looking for non-existent logs.
> 
> To aid in any future debugging, include all 8 bits of the NMISTAT
> register in the output, not just the two bits being used to determine
> this was "mynmi".  And provide names to the bits in NMISTAT so the
> code is easier to understand.
> 
> Signed-off-by: Steve Wahl <steve.wahl@hpe.com>

The subject should start with "watchdog:". I almost missed this patch.

Guenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Refine hpwdt message for UV platform
  2026-03-16 21:45 [PATCH] Refine hpwdt message for UV platform Steve Wahl
  2026-03-17 18:38 ` Guenter Roeck
  2026-03-17 18:39 ` Guenter Roeck
@ 2026-04-07 20:33 ` kernel test robot
  2026-04-07 21:08   ` Steve Wahl
  2 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2026-04-07 20:33 UTC (permalink / raw)
  To: Steve Wahl, Craig Lamparter, Wim Van Sebroeck, Guenter Roeck,
	linux-watchdog, linux-kernel
  Cc: oe-kbuild-all, Russ Anderson, Dimitri Sivanich, Kyle Meyer,
	Keng-Yu Lin, Collins

Hi Steve,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v7.0-rc7 next-20260406]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Steve-Wahl/Refine-hpwdt-message-for-UV-platform/20260317-060404
base:   linus/master
patch link:    https://lore.kernel.org/r/20260316214530.104344-1-steve.wahl%40hpe.com
patch subject: [PATCH] Refine hpwdt message for UV platform
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260408/202604080401.igdhwsPk-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260408/202604080401.igdhwsPk-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604080401.igdhwsPk-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/watchdog/hpwdt.c:28:10: fatal error: asm/uv/uv.h: No such file or directory
      28 | #include <asm/uv/uv.h>
         |          ^~~~~~~~~~~~~
   compilation terminated.


vim +28 drivers/watchdog/hpwdt.c

    13	
    14	#include <linux/device.h>
    15	#include <linux/hex.h>
    16	#include <linux/io.h>
    17	#include <linux/kernel.h>
    18	#include <linux/module.h>
    19	#include <linux/moduleparam.h>
    20	#include <linux/pci.h>
    21	#include <linux/pci_ids.h>
    22	#include <linux/types.h>
    23	#include <linux/watchdog.h>
    24	#ifdef CONFIG_HPWDT_NMI_DECODING
    25	#include <asm/nmi.h>
    26	#endif
    27	#include <linux/crash_dump.h>
  > 28	#include <asm/uv/uv.h>
    29	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Refine hpwdt message for UV platform
  2026-04-07 20:33 ` kernel test robot
@ 2026-04-07 21:08   ` Steve Wahl
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Wahl @ 2026-04-07 21:08 UTC (permalink / raw)
  To: kernel test robot
  Cc: Steve Wahl, Craig Lamparter, Wim Van Sebroeck, Guenter Roeck,
	linux-watchdog, linux-kernel, oe-kbuild-all, Russ Anderson,
	Dimitri Sivanich, Kyle Meyer, Keng-Yu Lin, Collins

On Wed, Apr 08, 2026 at 04:33:21AM +0800, kernel test robot wrote:
> Hi Steve,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v7.0-rc7 next-20260406]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://urldefense.com/v3/__https://git-scm.com/docs/git-format-patch*_base_tree_information__;Iw!!NpxR!k-fK0rnKrk8dIBbd23JT2Hng0qw5x1aXoW9xWZWDhdr7WZTO3hcYuKVmRkiMZZQjglHR8XZE$ ]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Steve-Wahl/Refine-hpwdt-message-for-UV-platform/20260317-060404 
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20260316214530.104344-1-steve.wahl%40hpe.com 
> patch subject: [PATCH] Refine hpwdt message for UV platform
> config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260408/202604080401.igdhwsPk-lkp@intel.com/config )
> compiler: alpha-linux-gcc (GCC) 15.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260408/202604080401.igdhwsPk-lkp@intel.com/reproduce )
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202604080401.igdhwsPk-lkp@intel.com/ 
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/watchdog/hpwdt.c:28:10: fatal error: asm/uv/uv.h: No such file or directory
>       28 | #include <asm/uv/uv.h>
>          |          ^~~~~~~~~~~~~
>    compilation terminated.

I wanted to note to all on this list that the robot tested v1 of the
patch.  v2 moved this include a couple of lines up, inside the #ifdef
CONFIG_HPWDT_NMI_DECODING section and should have eliminated this
issue.

The remaning lines touched by the patch are also within an #ifdef
CONFIG_HPWDT_NMI_DECODING section.

Thanks,

--> Steve Wahl

> 
> vim +28 drivers/watchdog/hpwdt.c
> 
>     13	
>     14	#include <linux/device.h>
>     15	#include <linux/hex.h>
>     16	#include <linux/io.h>
>     17	#include <linux/kernel.h>
>     18	#include <linux/module.h>
>     19	#include <linux/moduleparam.h>
>     20	#include <linux/pci.h>
>     21	#include <linux/pci_ids.h>
>     22	#include <linux/types.h>
>     23	#include <linux/watchdog.h>
>     24	#ifdef CONFIG_HPWDT_NMI_DECODING
>     25	#include <asm/nmi.h>
>     26	#endif
>     27	#include <linux/crash_dump.h>
>   > 28	#include <asm/uv/uv.h>
>     29	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki 

-- 
Steve Wahl, Hewlett Packard Enterprise

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-07 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 21:45 [PATCH] Refine hpwdt message for UV platform Steve Wahl
2026-03-17 18:38 ` Guenter Roeck
2026-03-17 18:39 ` Guenter Roeck
2026-04-07 20:33 ` kernel test robot
2026-04-07 21:08   ` Steve Wahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox