diff mbox series

[v2,1/3] watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO

Message ID 20231213215340.495734-2-jerry.hoemann@hpe.com
State New
Headers show
Series watchdog/hpwdt: Cleanup Claiming NMI | expand

Commit Message

Jerry Hoemann Dec. 13, 2023, 9:53 p.m. UTC
Avoid unnecessary crashes by claiming only NMIs that are due to
ERROR signalling or generated by the hpwdt hardware device.

The code does this, but only for iLO5.

The intent was to preserve legacy, Gen9 and earlier, semantics of
using hpwdt for error containtment as hardware/firmware would signal
fatal IO errors as an NMI with the expectation of hpwdt crashing
the system.  Howerver, these IO errors should be received by hpwdt
as an NMI_IO_CHECK.  So the test is overly permissive and should
not be limited to only ilo5.

We need to enable this protection for future iLOs not matching the
current PCI IDs.

Fixes: 62290a5c194b ("watchdog: hpwdt: Claim NMIs generated by iLO5")
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Dec. 13, 2023, 10:14 p.m. UTC | #1
On Wed, Dec 13, 2023 at 02:53:38PM -0700, Jerry Hoemann wrote:
> Avoid unnecessary crashes by claiming only NMIs that are due to
> ERROR signalling or generated by the hpwdt hardware device.
> 
> The code does this, but only for iLO5.
> 
> The intent was to preserve legacy, Gen9 and earlier, semantics of
> using hpwdt for error containtment as hardware/firmware would signal
> fatal IO errors as an NMI with the expectation of hpwdt crashing
> the system.  Howerver, these IO errors should be received by hpwdt
> as an NMI_IO_CHECK.  So the test is overly permissive and should
> not be limited to only ilo5.
> 
> We need to enable this protection for future iLOs not matching the
> current PCI IDs.
> 
> Fixes: 62290a5c194b ("watchdog: hpwdt: Claim NMIs generated by iLO5")
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/hpwdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index f79f932bca14..79ed1626d8ea 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -178,7 +178,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
>  		"3. OA Forward Progress Log\n"
>  		"4. iLO Event Log";
>  
> -	if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi)
> +	if (ulReason == NMI_UNKNOWN && !mynmi)
>  		return NMI_DONE;
>  
>  	if (ilo5 && !pretimeout && !mynmi)
> -- 
> 2.41.0
>
diff mbox series

Patch

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index f79f932bca14..79ed1626d8ea 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -178,7 +178,7 @@  static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
 		"3. OA Forward Progress Log\n"
 		"4. iLO Event Log";
 
-	if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi)
+	if (ulReason == NMI_UNKNOWN && !mynmi)
 		return NMI_DONE;
 
 	if (ilo5 && !pretimeout && !mynmi)