From: sashiko-bot@kernel.org
To: "Luca Leonardo Scorcia" <l.scorcia@gmail.com>
Cc: conor+dt@kernel.org, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 2/8] watchdog: mediatek: Add wdt/toprgu resets for MT6589
Date: Sun, 09 Aug 2026 16:29:22 +0000 [thread overview]
Message-ID: <20260809162922.B16F71F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260809160643.33991-3-l.scorcia@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Device configuration properties are parsed from the device tree after the watchdog device is registered and exposed to userspace.
- [High] The pretimeout interrupt service routine does not clear the hardware interrupt status, leading to an interrupt storm.
--
--- Patch [2]: [PATCH v3 2/8] watchdog: mediatek: Add wdt/toprgu resets for MT6589 ---
commit b68277d0ead460e42db1066fa50165b7b3c50d48
Author: Luca Leonardo Scorcia <l.scorcia@gmail.com>
watchdog: mediatek: Add wdt/toprgu resets for MT6589
This commit populates the toprgu_sw_rst_num field for the MT6589 watchdog to
allow toprgu resets in the device tree for compatible devices.
> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
> index 91d110646e16f..e61f6ae743276 100644
> --- a/drivers/watchdog/mtk_wdt.c
> +++ b/drivers/watchdog/mtk_wdt.c
[ ... ]
drivers/watchdog/mtk_wdt.c:mtk_wdt_probe() {
...
err = devm_watchdog_register_device(dev, &mtk_wdt->wdt_dev);
if (unlikely(err))
return err;
dev_info(dev, "Watchdog enabled (timeout=%d sec, nowayout=%d)\n",
mtk_wdt->wdt_dev.timeout, nowayout);
wdt_data = of_device_get_match_data(dev);
if (wdt_data) {
err = toprgu_register_reset_controller(pdev,
wdt_data->toprgu_sw_rst_num);
if (err)
return err;
mtk_wdt->has_swsysrst_en = wdt_data->has_swsysrst_en;
}
mtk_wdt->disable_wdt_extrst =
of_property_read_bool(dev->of_node, "mediatek,disable-extrst");
...
}
[Severity: High]
This isn't a bug introduced by this patch, but could this cause the watchdog
hardware to be misconfigured if it's opened immediately after registration?
The watchdog character device is fully registered and exposed to
userspace before the configuration flags (like mediatek,disable-extrst
and mediatek,reset-by-toprgu) are parsed from the device tree.
If a userspace process opens /dev/watchdog and starts it right after
devm_watchdog_register_device() completes, but before mtk_wdt_probe()
finishes parsing these properties, could the system fail to reset properly
when the watchdog triggers?
drivers/watchdog/mtk_wdt.c:mtk_wdt_isr() {
struct watchdog_device *wdd = arg;
watchdog_notify_pretimeout(wdd);
return IRQ_HANDLED;
}
[Severity: High]
This is a pre-existing issue, but does this interrupt handler need to clear
the hardware interrupt status?
It successfully notifies the core but returns IRQ_HANDLED without
interacting with the device registers (like calling mtk_wdt_ping()) to
acknowledge and clear the interrupt source.
Since this is a level-triggered IRQ, could returning IRQ_HANDLED without
explicitly clearing the hardware interrupt status cause the CPU to endlessly
loop servicing the unacknowledged interrupt, leading to an interrupt storm
and system hang?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260809160643.33991-1-l.scorcia@gmail.com?part=2
next prev parent reply other threads:[~2026-08-09 16:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-09 16:03 [PATCH v3 0/8] Properly describe mt6589 and mt8167 toprgu resets Luca Leonardo Scorcia
2026-08-09 16:03 ` [PATCH v3 1/8] dt-bindings: reset: Add mt6589 toprgu reset IDs Luca Leonardo Scorcia
2026-08-09 16:03 ` [PATCH v3 2/8] watchdog: mediatek: Add wdt/toprgu resets for MT6589 Luca Leonardo Scorcia
2026-08-09 16:29 ` sashiko-bot [this message]
2026-08-09 16:03 ` [PATCH v3 3/8] arm: dts: mediatek: mt6589: Enable toprgu reset controller Luca Leonardo Scorcia
2026-08-09 17:04 ` Akari Tsuyukusa
2026-08-09 17:08 ` Luca Leonardo Scorcia
2026-08-09 17:16 ` Akari Tsuyukusa
2026-08-09 17:49 ` Guenter Roeck
2026-08-09 18:55 ` Luca Leonardo Scorcia
2026-08-09 19:09 ` Guenter Roeck
2026-08-09 16:03 ` [PATCH v3 4/8] dt-bindings: watchdog: Add compatible for MediaTek mt8167 Luca Leonardo Scorcia
2026-08-09 16:23 ` sashiko-bot
2026-08-09 16:03 ` [PATCH v3 5/8] dt-bindings: reset: Add reset controller constants for mt8167 Luca Leonardo Scorcia
2026-08-09 16:25 ` sashiko-bot
2026-08-09 16:03 ` [PATCH v3 6/8] watchdog: mediatek: Add support for mt8167 TOPRGU/WDT Luca Leonardo Scorcia
2026-08-09 16:03 ` [PATCH v3 7/8] arm64: dts: mt8167: Properly describe the SoC watchdog Luca Leonardo Scorcia
2026-08-09 16:03 ` [PATCH v3 8/8] soc: mediatek: mtk-mmsys: Add resets for mt8167 Luca Leonardo Scorcia
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=20260809162922.B16F71F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=l.scorcia@gmail.com \
--cc=linux-watchdog@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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