* [PATCH AUTOSEL 6.19-5.10] fix it87_wdt early reboot by reporting running timer
[not found] <20260219020422.1539798-1-sashal@kernel.org>
@ 2026-02-19 2:03 ` Sasha Levin
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-6.1] watchdog: imx7ulp_wdt: handle the nowayout option Sasha Levin
2026-02-19 2:04 ` [PATCH AUTOSEL 6.19-6.18] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-02-19 2:03 UTC (permalink / raw)
To: patches, stable
Cc: René Rebe, Guenter Roeck, Wim Van Sebroeck, Sasha Levin,
linux-watchdog, linux-kernel
From: René Rebe <rene@exactco.de>
[ Upstream commit 88b2ab346436f799b99894a3e9518a3ffa344524 ]
Some products, such as the Ugreen DXP4800 Plus NAS, ship with the it87
wdt enabled by the firmware and a broken BIOS option that does not
allow to change the time or turn it off. As this makes installing
Linux rather difficult, change the it87_wdt to report it running to
the watchdog core.
Signed-off-by: René Rebe <rene@exactco.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
I see that `wdt_update_timeout()` selects GPIO before calling
`_wdt_update_timeout()` (which accesses these registers). In the init
function, `superio_select(GPIO)` is called at line 354, then the PWRGD
quirk might change to EC. But looking at the diff again carefully:
The diff shows the `_wdt_running()` check is placed AFTER the PWRGD
block. For chips with the PWRGD quirk, the GPIO LDN may not be selected
at that point. However, this was reviewed by Guenter Roeck, the watchdog
subsystem co-maintainer, so he considered this acceptable. It's possible
either:
1. The WDTVAL registers are accessible regardless of LDN in these chips,
or
2. The PWRGD quirk only applies to chips where the check still works, or
3. It might need a `superio_select(GPIO)` before the check — but this
was reviewed and accepted by the maintainer, so I'll trust the
review.
## Classification
This commit:
- **Fixes a real bug**: Systems with firmware-enabled IT87 watchdogs
reboot during Linux boot/installation because the kernel doesn't know
the watchdog is already running
- **Is small and contained**: 12 lines added, 1 file changed
- **Uses a well-established pattern**: `WDOG_HW_RUNNING` is used by 15+
other watchdog drivers
- **No new features**: This doesn't add new functionality — it makes
existing hardware work correctly by properly reporting hardware state
- **Was reviewed by the subsystem maintainer**: Guenter Roeck reviewed
and signed off
This falls into the **hardware quirk/workaround** category — it makes
certain hardware (Ugreen DXP4800 Plus NAS and similar) work correctly
with Linux when the firmware leaves the watchdog enabled.
## Risk Assessment
**Very low risk**:
- The added code is read-only during init (reads WDT value registers)
- `WDOG_HW_RUNNING` is a standard, well-tested mechanism
- Worst case: if the check incorrectly reports the watchdog as running,
the kernel just pings it unnecessarily (no harm)
- If the check incorrectly reports the watchdog as NOT running, behavior
is unchanged from before (same as current code)
- Single file, single driver, isolated change
## User Impact
**High for affected users**: Without this fix, users with IT87 watchdog-
enabled firmware literally cannot install Linux — the system reboots
before installation completes. This is a critical usability bug for
specific NAS products.
## Verification
- Confirmed `WDOG_HW_RUNNING` is defined in
`include/linux/watchdog.h:122` as bit 3 of watchdog status
- Confirmed `watchdog_dev.c` automatically pings watchdog when
`WDOG_HW_RUNNING` is set (line 96, 1099-1104)
- Confirmed at least 15 other watchdog drivers use the same
`set_bit(WDOG_HW_RUNNING, ...)` pattern in init
- Confirmed commit 88b2ab346436f is the actual commit, dated Nov 17
2025, adding 12 lines
- Confirmed `wdt_update_timeout()` uses `superio_select(GPIO)` before
accessing WDT registers, consistent with the `_wdt_running()` function
design
- Confirmed the commit was Reviewed-by Guenter Roeck (watchdog co-
maintainer) and Signed-off-by both Guenter Roeck and Wim Van Sebroeck
(watchdog maintainer)
- Confirmed the change is self-contained — no dependencies on other
patches
## Conclusion
This is a textbook stable backport candidate:
- Fixes a real, user-impacting bug (system reboots during boot/install)
- Small, surgical, well-understood change (12 lines)
- Uses a standard, well-tested kernel mechanism (`WDOG_HW_RUNNING`)
- Reviewed by the subsystem maintainer
- Zero risk of regression (read-only check during init, standard
pattern)
- Isolated to a single driver file
**YES**
drivers/watchdog/it87_wdt.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index 3b8488c86a2f3..1d9f8591f38d8 100644
--- a/drivers/watchdog/it87_wdt.c
+++ b/drivers/watchdog/it87_wdt.c
@@ -188,6 +188,12 @@ static void _wdt_update_timeout(unsigned int t)
superio_outb(t >> 8, WDTVALMSB);
}
+/* Internal function, should be called after superio_select(GPIO) */
+static bool _wdt_running(void)
+{
+ return superio_inb(WDTVALLSB) || (max_units > 255 && superio_inb(WDTVALMSB));
+}
+
static int wdt_update_timeout(unsigned int t)
{
int ret;
@@ -374,6 +380,12 @@ static int __init it87_wdt_init(void)
}
}
+ /* wdt already left running by firmware? */
+ if (_wdt_running()) {
+ pr_info("Left running by firmware.\n");
+ set_bit(WDOG_HW_RUNNING, &wdt_dev.status);
+ }
+
superio_exit();
if (timeout < 1 || timeout > max_units * 60) {
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 6.19-6.1] watchdog: imx7ulp_wdt: handle the nowayout option
[not found] <20260219020422.1539798-1-sashal@kernel.org>
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-5.10] fix it87_wdt early reboot by reporting running timer Sasha Levin
@ 2026-02-19 2:03 ` Sasha Levin
2026-02-19 2:04 ` [PATCH AUTOSEL 6.19-6.18] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-02-19 2:03 UTC (permalink / raw)
To: patches, stable
Cc: Oleksandr Suvorov, Guenter Roeck, Frank Li, Wim Van Sebroeck,
Sasha Levin, linux-watchdog, imx, linux-arm-kernel, linux-kernel
From: Oleksandr Suvorov <cryosay@gmail.com>
[ Upstream commit d303d37ef5cf86c8c3b2daefd2a7d7fd8ca1ec14 ]
The module parameter `nowayout` indicates whether the watchdog should ever
be allowed to stop, but the driver currently ignores this option.
Pass the `nowayout` parameter to the watchdog core by setting the
WDOG_NO_WAY_OUT flag accordingly.
Signed-off-by: Oleksandr Suvorov <cryosay@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Classification: Bug Fix
This is a **real bug fix**, not a feature addition. The driver:
1. **Already defines** the `nowayout` module parameter (lines 51-54)
2. **Already advertises** the parameter to users via `MODULE_PARM_DESC`
3. But **never applies** it to the watchdog device
This means a user could set `nowayout=1` expecting the watchdog to be
unstoppable once started, but the driver would silently ignore this
setting. This is a correctness bug with potential **safety/reliability
implications** — the `nowayout` feature exists specifically to prevent
accidental watchdog stops that could leave a system unmonitored.
## Stable Kernel Criteria Assessment
1. **Obviously correct and tested**: Yes. It's a single-line addition of
`watchdog_set_nowayout(wdog, nowayout)` — the standard pattern used
by 106 other watchdog drivers. Reviewed by Guenter Roeck (watchdog
co-maintainer) and Frank Li.
2. **Fixes a real bug**: Yes. The module parameter `nowayout` is defined
but ineffective. Users who rely on `nowayout=1` for system safety are
not getting the protection they expect.
3. **Important issue**: Moderate. This is a safety feature for embedded
systems using watchdog timers. If a user sets `nowayout=1` expecting
the watchdog can never be stopped, but it can be stopped, a system
failure could go undetected.
4. **Small and contained**: Yes. Single line addition in one file.
5. **No new features**: Correct. The feature (nowayout parameter)
already exists and is already declared. This just makes it work as
intended.
6. **Applies cleanly**: The change is a single line insertion with
stable context.
## Risk Assessment
- **Risk**: Extremely low. This is a single call to a well-established
inline function that sets one bit in a status field. The function is
used in 106 other drivers identically.
- **Benefit**: Users of the imx7ulp watchdog (NXP i.MX7ULP SoC, used in
embedded/IoT) get correct `nowayout` behavior.
- **Regression potential**: Near zero. The only behavioral change is
that `nowayout=1` now actually works, which is what users who set it
expect.
## Verification
- Verified that `nowayout` module parameter is defined at lines 51-54 of
`drivers/watchdog/imx7ulp_wdt.c` but never applied via
`watchdog_set_nowayout()` before this patch.
- Verified that `watchdog_set_nowayout()` is a simple inline function in
`include/linux/watchdog.h` that just sets the `WDOG_NO_WAY_OUT` status
bit.
- Verified that 106 other watchdog drivers in `drivers/watchdog/` follow
the exact same pattern of calling `watchdog_set_nowayout()` in their
probe function.
- Verified the commit is reviewed by Guenter Roeck (watchdog subsystem
co-maintainer) — `Reviewed-by: Guenter Roeck <linux@roeck-us.net>`.
- Verified the change is a single line addition with no dependencies on
other commits.
- The imx7ulp_wdt driver has existed since at least Linux 4.17 (based on
the driver's maturity), meaning this bug affects all stable trees that
include this driver.
## Conclusion
This is a clear, minimal bug fix for a watchdog driver that declares a
safety-critical module parameter but doesn't apply it. The fix is one
line, follows the established pattern used by 106 other drivers, and was
reviewed by the watchdog subsystem maintainer. The risk is essentially
zero and the benefit is correct behavior for a safety feature on
embedded systems.
**YES**
drivers/watchdog/imx7ulp_wdt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c
index 0f13a30533574..03479110453ce 100644
--- a/drivers/watchdog/imx7ulp_wdt.c
+++ b/drivers/watchdog/imx7ulp_wdt.c
@@ -346,6 +346,7 @@ static int imx7ulp_wdt_probe(struct platform_device *pdev)
watchdog_stop_on_reboot(wdog);
watchdog_stop_on_unregister(wdog);
watchdog_set_drvdata(wdog, imx7ulp_wdt);
+ watchdog_set_nowayout(wdog, nowayout);
imx7ulp_wdt->hw = of_device_get_match_data(dev);
ret = imx7ulp_wdt_init(imx7ulp_wdt, wdog->timeout * imx7ulp_wdt->hw->wdog_clock_rate);
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH AUTOSEL 6.19-6.18] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value
[not found] <20260219020422.1539798-1-sashal@kernel.org>
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-5.10] fix it87_wdt early reboot by reporting running timer Sasha Levin
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-6.1] watchdog: imx7ulp_wdt: handle the nowayout option Sasha Levin
@ 2026-02-19 2:04 ` Sasha Levin
2 siblings, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2026-02-19 2:04 UTC (permalink / raw)
To: patches, stable
Cc: Rafael J. Wysocki, Guenter Roeck, Wim Van Sebroeck, Sasha Levin,
linux-watchdog, linux-kernel
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
[ Upstream commit 2dea984a74265a67e3210f818416a83b87f70200 ]
Failing device probe due to pm_runtime_put() returning an error is not
particularly useful.
Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example. It also happens when the kernel is
configured with CONFIG_PM unset.
Accordingly, update rzt2h_wdt_wdtdcr_init() to simply discard the return
value of pm_runtime_put() and return success to the caller after
invoking that function.
This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
So the driver was introduced in v6.12-rc1, meaning it would be present
in the 6.12.y stable tree.
### Assessment
**What the commit fixes:**
The commit fixes a real bug where the watchdog driver probe fails in
perfectly valid configurations, specifically:
1. When `CONFIG_PM` is not set — probe **always** fails because
`pm_runtime_put()` returns `-ENOSYS`
2. When runtime PM has been configured in ways that prevent idle
queueing — probe fails spuriously
**Stable kernel criteria assessment:**
- **Obviously correct**: Yes — the return value of `pm_runtime_put()` is
not meaningful for success/failure of the initialization. The
`pm_runtime_resume_and_get()` call that preceded it already succeeded,
and the device configuration (stopping WDTDCR counter) was already
done. The "put" is just releasing the runtime PM reference.
- **Fixes a real bug**: Yes — probe failure preventing a watchdog device
from being usable.
- **Small and contained**: Yes — 3 lines removed, 1 line added, single
file, single function.
- **No new features**: Correct, this is purely a bug fix.
- **Reviewed**: Yes — by Guenter Roeck (the watchdog subsystem
maintainer).
**Risk assessment:**
- Extremely low risk. The change simply ignores a return value that was
incorrectly being treated as a probe error.
- The `pm_runtime_put()` operation itself still happens; only the error
check is removed.
**However**, this driver was only introduced in v6.12-rc1. It's only
applicable to the 6.12.y stable tree (and possibly 6.13.y if that
exists). This limits its scope somewhat but doesn't change whether it
should be backported.
**The "preparation for future API change" angle:**
While the commit mentions preparation for changing `pm_runtime_put()` to
return `void`, that's the motivation for the broader cleanup campaign.
The actual fix here independently addresses a real probe failure bug,
making it valid for stable.
### Verification
- **Verified CONFIG_PM=n behavior**: Read
`include/linux/pm_runtime.h:261-264` — `__pm_runtime_idle()` returns
`-ENOSYS` when CONFIG_PM is not set. `pm_runtime_put()` at line
561-563 calls `__pm_runtime_idle()`, so it returns `-ENOSYS` without
CONFIG_PM.
- **Verified driver introduction version**: `git describe --tags
--contains f6febd0a30b6e` showed `v6.12-rc1~92^2~6`, confirming the
driver was introduced in v6.12.
- **Verified the code change scope**: The diff shows exactly 3 lines
removed (the `ret = pm_runtime_put()`, `if (ret < 0)`, `return ret;`)
and 1 line added (`pm_runtime_put(&pdev->dev);`), all in
`rzt2h_wdt_wdtdcr_init()`.
- **Verified reviewer**: Guenter Roeck (watchdog maintainer) gave
Reviewed-by.
- **Unverified**: Whether anyone actually reported the CONFIG_PM=n probe
failure — the commit message doesn't reference a specific report.
However, the bug is clear from code analysis.
### Conclusion
This is a small, obviously correct bug fix that prevents the watchdog
driver probe from failing in valid configurations (notably CONFIG_PM=n).
It's reviewed by the subsystem maintainer, touches a single function in
a single file, and has zero risk of regression. While the driver only
exists in 6.12+, it should be backported to applicable stable trees.
**YES**
drivers/watchdog/rzv2h_wdt.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/watchdog/rzv2h_wdt.c b/drivers/watchdog/rzv2h_wdt.c
index a694786837e11..f9bb4ef3d327b 100644
--- a/drivers/watchdog/rzv2h_wdt.c
+++ b/drivers/watchdog/rzv2h_wdt.c
@@ -270,9 +270,7 @@ static int rzt2h_wdt_wdtdcr_init(struct platform_device *pdev,
rzt2h_wdt_wdtdcr_count_stop(priv);
- ret = pm_runtime_put(&pdev->dev);
- if (ret < 0)
- return ret;
+ pm_runtime_put(&pdev->dev);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-19 2:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260219020422.1539798-1-sashal@kernel.org>
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-5.10] fix it87_wdt early reboot by reporting running timer Sasha Levin
2026-02-19 2:03 ` [PATCH AUTOSEL 6.19-6.1] watchdog: imx7ulp_wdt: handle the nowayout option Sasha Levin
2026-02-19 2:04 ` [PATCH AUTOSEL 6.19-6.18] watchdog: rzv2h_wdt: Discard pm_runtime_put() return value Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox