mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Paul Louvel <paul.louvel@bootlin.com>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v3 1/6] watchdog: w83627hf_wdt: Replace magic numbers with descriptive macros
Date: Tue, 6 Oct 2026 14:24:02 +0000	[thread overview]
Message-ID: <asUEgunBdF6N9LCA@google.com> (raw)
In-Reply-To: <20261004-w83627hf_wdt-improvements-v3-1-8e27b518595e@bootlin.com>

On Sun, Oct 04, 2026 at 02:12:49PM +0200, Paul Louvel wrote:
> @@ -71,6 +72,12 @@ MODULE_PARM_DESC(early_disable, "Disable watchdog at boot time (default=0)");
>   *	Kernel methods.
>   */
>  
> +#define SIO_REG_LDSEL		0x07	/* Logical device select */
> +#define SIO_REG_DEVID		0x20	/* Device ID (1 or 2 bytes) */
> +#define SIO_REG_ENABLE		0x30	/* Logical device enable */
> +#define SIO_REG_CONF_ADDR0	0x2E
> +#define SIO_REG_CONF_ADDR1	0x4E

They are actually I/O ports rather than SIO registers.  SIO_PORT_2E and
SIO_PORT_4E (or SIO_CONF_PORT_*) would be better names to distinguish them
from SIO_REG_*.

> @@ -248,16 +258,17 @@ static int w83627hf_init(struct watchdog_device *wdog, enum chips chip)
>  		}
>  	}
>  
> -	/* set second mode & disable keyboard turning off watchdog */
> -	t = superio_inb(cr_wdt_control) & ~0x0C;
> +	/* set second mode & disable keyboard reset turning off watchdog */

This is confusing.  How about:

    /* set second mode & disable watchdog reload on keyboard reset */

> +	t = superio_inb(cr_wdt_control) &
> +	    ~(WDT_CTRL_MINUTE_MODE | WDT_CTRL_RISING_EDGE_KBD_RESET);
>  	superio_outb(cr_wdt_control, t);
>  
>  	t = superio_inb(cr_wdt_csr);
>  	if (t & WDT_CSR_STATUS)
>  		wdog->bootstatus |= WDIOF_CARDRESET;
>  
> -	/* reset status, disable keyboard & mouse turning off watchdog */
> -	t &= ~(WDT_CSR_STATUS | WDT_CSR_KBD | WDT_CSR_MOUSE);
> +	/* reset status, disable keyboard & mouse interrupt turning off watchdog */

Same here.  How about:

    /* reset status & disable watchdog reload on keyboard/mouse interrupts */

> @@ -513,11 +524,11 @@ static int __init wdt_init(void)
>  	/* Apply system-specific quirks */
>  	dmi_check_system(wdt_dmi_table);
>  
> -	wdt_io = 0x2e;
> -	chip = wdt_find(0x2e);
> +	wdt_io = SIO_REG_CONF_ADDR0;
> +	chip = wdt_find(SIO_REG_CONF_ADDR0);
>  	if (chip < 0) {
> -		wdt_io = 0x4e;
> -		chip = wdt_find(0x4e);
> +		wdt_io = SIO_REG_CONF_ADDR1;
> +		chip = wdt_find(SIO_REG_CONF_ADDR1);

I noticed the 'addr' parameter in wdt_find() is unused.  We could consider
removing it in a later cleanup patch.

  reply	other threads:[~2026-10-06 14:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 12:12 [PATCH v3 0/6] watchdog: w83627hf_wdt: Convert driver to the driver model and add minute support Paul Louvel
2026-10-04 12:12 ` [PATCH v3 1/6] watchdog: w83627hf_wdt: Replace magic numbers with descriptive macros Paul Louvel
2026-10-06 14:24   ` Tzung-Bi Shih [this message]
2026-10-04 12:12 ` [PATCH v3 2/6] watchdog: w83627hf_wdt: Convert to platform driver model Paul Louvel
2026-10-06 14:24   ` Tzung-Bi Shih
2026-10-07 17:05   ` kernel test robot
2026-10-04 12:12 ` [PATCH v3 3/6] watchdog: w83627hf_wdt: Move register offsets into driver data Paul Louvel
2026-10-06 14:25   ` Tzung-Bi Shih
2026-10-04 12:12 ` [PATCH v3 4/6] watchdog: w83627hf_wdt: Store Super I/O configurations in platform data Paul Louvel
2026-10-06 14:25   ` Tzung-Bi Shih
2026-10-04 12:12 ` [PATCH v3 5/6] watchdog: w83627hf_wdt: Add minute mode counting Paul Louvel
2026-10-04 12:12 ` [PATCH v3 6/6] watchdog: w83627hf_wdt: Report all initialization failures in probe Paul Louvel
2026-10-06 14:25   ` Tzung-Bi Shih

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=asUEgunBdF6N9LCA@google.com \
    --to=tzungbi@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=paul.louvel@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wim@linux-watchdog.org \
    /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

all inboxes | Powered by JetHome®