From: sashiko-bot@kernel.org
To: "Pan Chuang" <panchuang@vivo.com>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 9/9] watchdog: sprd: Remove redundant dev_err()
Date: Wed, 22 Jul 2026 08:51:53 +0000 [thread overview]
Message-ID: <20260722085153.94D9A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722084218.79073-10-panchuang@vivo.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Incorrect devres ordering leaves the IRQ handler active while device clocks are disabled, risking a Data Abort (kernel panic).
--
--- Patch [9]: [PATCH 9/9] watchdog: sprd: Remove redundant dev_err() ---
commit a68eda5f5b396a6d33ede72c1a4cc217df36d52f
Author: Pan Chuang <panchuang@vivo.com>
watchdog: sprd: Remove redundant dev_err()
This commit removes a redundant driver-specific dev_err() call after
devm_request_irq(). The core already logs detailed error messages on
failure.
> diff --git a/drivers/watchdog/sprd_wdt.c b/drivers/watchdog/sprd_wdt.c
> index aacf04616fefe..616b4d7f21d78 100644
> --- a/drivers/watchdog/sprd_wdt.c
> +++ b/drivers/watchdog/sprd_wdt.c
> @@ -293,10 +293,8 @@ static int sprd_wdt_probe(struct platform_device *pdev)
>
> ret = devm_request_irq(dev, wdt->irq, sprd_wdt_isr, IRQF_NO_SUSPEND,
> "sprd-wdt", (void *)wdt);
[Severity: High]
This is a pre-existing issue, but I noticed a potential race condition
with the devres ordering.
Since devm_request_irq() is called before sprd_wdt_enable(), could a pending
interrupt (e.g., from the bootloader) trigger sprd_wdt_isr() while the device
clocks are still disabled?
Also, since devres teardown is LIFO, sprd_wdt_disable() (registered further
down via devm_add_action_or_reset()) will execute before the IRQ is freed
on probe failure or device removal. This leaves a window where the ISR could
fire and access registers with clocks disabled:
sprd_wdt_isr() {
...
sprd_wdt_unlock(wdt->base);
writel_relaxed(SPRD_WDT_INT_CLEAR_BIT, wdt->base + SPRD_WDT_INT_CLR);
...
}
Would it be safer to request the IRQ after the clocks are enabled and the
disable action is registered, to prevent a potential Data Abort?
> - if (ret) {
> - dev_err(dev, "failed to register irq\n");
> + if (ret)
> return ret;
> - }
>
> wdt->wdd.info = &sprd_wdt_info;
> wdt->wdd.ops = &sprd_wdt_ops;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260722084218.79073-1-panchuang@vivo.com?part=9
prev parent reply other threads:[~2026-07-22 8:51 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
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 [this message]
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=20260722085153.94D9A1F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.