Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Wayen Yan <win847@gmail.com>
To: linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Christian Marangi <ansuelsmth@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: airoha: validate heartbeat module parameter
Date: Wed, 08 Jul 2026 13:55:12 +0800	[thread overview]
Message-ID: <178349011293.87032.15993825644278020262@gmail.com> (raw)

Please do not apply the above patch. It introduces a regression:

The patch removes the direct assignment "wdog_dev->timeout = heartbeat"
and relies on watchdog_init_timeout() instead. However, since wdog_dev
is allocated via devm_kzalloc(), timeout is initialized to 0. If the
heartbeat module parameter is invalid and there is no "timeout-sec" DT
property, watchdog_init_timeout() returns -EINVAL and leaves timeout
at 0. When the watchdog is subsequently started, airoha_wdt_start()
writes 0 * wdt_freq = 0 to WDT_TIMER_LOAD_VALUE, causing an immediate
hardware reboot — which is worse than the original overflow bug.

I will send a v2 patch that:
1. Pre-initializes timeout to WDT_HEARTBEAT before calling
   watchdog_init_timeout(), so the safe default is preserved on failure
2. Sets min_timeout = 1 to prevent timeout = 0 via ioctl

Sorry for the noise.

Wayen


             reply	other threads:[~2026-07-08  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  5:55 Wayen Yan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-08  5:24 [PATCH] watchdog: airoha: validate heartbeat module parameter Wayen Yan
2026-07-08  5:36 ` sashiko-bot

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=178349011293.87032.15993825644278020262@gmail.com \
    --to=win847@gmail.com \
    --cc=ansuelsmth@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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