public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Oleksandr Ocheretnyi <oocheret@cisco.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.de>, Wolfram Sang <wsa@kernel.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	xe-linux-external@cisco.com
Subject: Re: [PATCH v1] iTCO_wdt: ignore NMI_NOW bit on register comparison
Date: Mon, 26 Aug 2024 14:18:11 +0300	[thread overview]
Message-ID: <20240826111811.GP1532424@black.fi.intel.com> (raw)
In-Reply-To: <20240826075303.3964392-1-oocheret@cisco.com>

Hi,

On Mon, Aug 26, 2024 at 12:53:01AM -0700, Oleksandr Ocheretnyi wrote:
> Commit da23b6faa8bf ("watchdog: iTCO: Add support for Cannon Lake
> PCH iTCO") does not ignore NMI_NOW bit on write operation to TCO1_CNT
> register what causes unexpected NMIs due to NMI_NOW bit inversion
> during regular crashkernel's workflow with following logs:
> 
> iTCO_vendor_support: vendor-support=0
> iTCO_wdt iTCO_wdt: unable to reset NO_REBOOT flag, device
>                                             disabled by hardware/BIOS
> 
> This change clears NMI_NOW bit in the TCO1_CNT register to have no
> effect on NMI_NOW bit inversion what can cause NMI immediately.
> 
> Fixes: da23b6faa8bf ("watchdog: iTCO: Add support for Cannon Lake PCH iTCO")
> Signed-off-by: Oleksandr Ocheretnyi <oocheret@cisco.com>
> ---
>  drivers/watchdog/iTCO_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
> index 264857d314da..679c115ef7d3 100644
> --- a/drivers/watchdog/iTCO_wdt.c
> +++ b/drivers/watchdog/iTCO_wdt.c
> @@ -224,7 +224,7 @@ static int update_no_reboot_bit_cnt(void *priv, bool set)
>  		val |= BIT(0);
>  	else
>  		val &= ~BIT(0);
> -	outw(val, TCO1_CNT(p));
> +	outw(val & ~BIT(8), TCO1_CNT(p));

I suggest adding some #define for the magical number 8 so that it is
easier for anyone looking at this driver to figure out what it is doing.

Otherwise looks good to me, thanks!

>  	newval = inw(TCO1_CNT(p));
>  
>  	/* make sure the update is successful */
> -- 
> 2.39.3

  reply	other threads:[~2024-08-26 11:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26  7:53 [PATCH v1] iTCO_wdt: ignore NMI_NOW bit on register comparison Oleksandr Ocheretnyi
2024-08-26 11:18 ` Mika Westerberg [this message]
2024-08-26 15:12   ` Guenter Roeck
2024-08-26 15:15     ` Guenter Roeck
2024-08-26 15:41       ` Guenter Roeck
2024-09-12 14:19         ` [PATCH v2] iTCO_wdt: mask NMI_NOW bit for update_no_reboot_bit() call Oleksandr Ocheretnyi
2024-09-12 21:15           ` Guenter Roeck
2024-09-12 21:15           ` Guenter Roeck
2024-09-13 19:14             ` [PATCH v3] " Oleksandr Ocheretnyi
2024-09-17  1:09               ` Guenter Roeck
2024-10-07 15:57                 ` Oleksandr Ocheretnyi
2024-10-08 16:33                   ` Mika Westerberg
2024-09-13  5:29           ` [PATCH v2] " kernel test robot
2024-09-13  7:58           ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240826111811.GP1532424@black.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=jdelvare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=oocheret@cisco.com \
    --cc=wim@linux-watchdog.org \
    --cc=wsa@kernel.org \
    --cc=xe-linux-external@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox