From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 6/9] watchdog: orion: Remove redundant dev_err()
Date: Wed, 22 Jul 2026 08:50:40 +0000 [thread overview]
Message-ID: <20260722085041.238781F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722084218.79073-7-panchuang@vivo.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] The probe function silently ignores probe deferral and other errors from platform_get_irq_optional().
- [High] The driver incorrectly modifies a static global watchdog_info structure during device probe.
--
--- Patch [6]: [PATCH 6/9] watchdog: orion: Remove redundant dev_err() ---
commit 820e86c1dcc7da8eb296b1915c4c9eb8f9dc8666
Author: Pan Chuang <panchuang@vivo.com>
watchdog: orion: Remove redundant dev_err()
This commit removes redundant dev_err() messages in the driver, as
devm_request_irq() automatically logs errors on failure.
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 0e145f762f6f2..1802634cc7cda 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -613,10 +613,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
> */
> ret = devm_request_irq(&pdev->dev, irq, orion_wdt_irq, 0,
> pdev->name, dev);
[Severity: High]
This isn't a bug introduced by this patch, but does orion_wdt_probe() silently
ignore probe deferrals when getting these interrupts?
Earlier in this function, the primary and secondary interrupts are fetched:
irq = platform_get_irq_optional(pdev, 0);
if (irq > 0) {
If the interrupt controller is not yet ready, platform_get_irq_optional()
returns -EPROBE_DEFER. Because of the if (irq > 0) check, we silently skip
the interrupts instead of propagating the error and deferring the probe. This
can cause the watchdog to permanently drop its interrupt-driven capabilities on
boot.
> - if (ret < 0) {
> - dev_err(&pdev->dev, "failed to request IRQ\n");
> + if (ret < 0)
> goto disable_clk;
> - }
> }
>
> /* Optional 2nd interrupt for pretimeout */
> @@ -625,10 +623,8 @@ static int orion_wdt_probe(struct platform_device *pdev)
> orion_wdt_info.options |= WDIOF_PRETIMEOUT;
[Severity: High]
This is a pre-existing issue, but does this permanently corrupt the static
global orion_wdt_info struct for the lifetime of the module?
If the driver successfully finds a pretimeout interrupt during probe, it
permanently modifies the shared static global orion_wdt_info structure by
setting WDIOF_PRETIMEOUT.
If the device is subsequently unbound and re-bound to a hardware configuration
without the interrupt, or if multiple SoC instances exist with differing
interrupt capabilities, the driver will inherit the corrupted global state and
falsely advertise the pretimeout feature to userspace.
> ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq,
> 0, pdev->name, dev);
> - if (ret < 0) {
> - dev_err(&pdev->dev, "failed to request IRQ\n");
> + if (ret < 0)
> goto disable_clk;
> - }
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260722084218.79073-1-panchuang@vivo.com?part=6
next prev parent reply other threads:[~2026-07-22 8:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 8:42 [PATCH 0/9] watchdog: Remove redundant error messages on IRQ request failure Pan Chuang
2026-07-22 8:42 ` [PATCH 1/9] watchdog: bd96801_wdt: Remove redundant dev_err_probe() Pan Chuang
2026-07-22 8:58 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 2/9] watchdog: cadence_wdt: Remove redundant dev_err() Pan Chuang
2026-07-22 8:52 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 3/9] watchdog: intel-mid_wdt: " Pan Chuang
2026-07-22 8:49 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 4/9] watchdog: keembay: Remove redundant dev_err_probe() Pan Chuang
2026-07-22 8:51 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 5/9] watchdog: marvell_gti: " Pan Chuang
2026-07-22 8:51 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 6/9] watchdog: orion: Remove redundant dev_err() Pan Chuang
2026-07-22 8:50 ` sashiko-bot [this message]
2026-07-22 8:42 ` [PATCH 7/9] watchdog: realtek_otto: Remove redundant dev_err_probe() Pan Chuang
2026-07-22 8:55 ` sashiko-bot
2026-07-22 8:42 ` [PATCH 8/9] watchdog: sama5d4: Remove redundant dev_err() Pan Chuang
2026-07-22 8:48 ` sashiko-bot
2026-07-22 9:20 ` Alexandre Belloni
2026-07-22 8:42 ` [PATCH 9/9] watchdog: sprd: " Pan Chuang
2026-07-22 8:51 ` 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=20260722085041.238781F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=panchuang@vivo.com \
--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