All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rosen Penev" <rosenp@gmail.com>
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH] watchdog: ath79_wdt: select OF and COMPILE_TEST
Date: Mon, 18 May 2026 21:19:24 +0000	[thread overview]
Message-ID: <20260518211925.A24FDC2BCB7@smtp.kernel.org> (raw)
In-Reply-To: <20260518210957.10545-1-rosenp@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Permanent failure of deferred probing and device re-binding due to uncleared global `wdt_base` pointer on error paths.
- [Medium] Mismatch between Kconfig changes and commit message regarding OF dependency.
--

commit 279311df3b831cb8a967974beeea1a51baecd0ac
Author: Rosen Penev <rosenp@gmail.com>

watchdog: ath79_wdt: select OF and COMPILE_TEST

This has always been an OF driver. Select OF in Kconfig.

Add COMPILE_TEST for all platforms, not just ARM.

> watchdog: ath79_wdt: select OF and COMPILE_TEST
> 
> This has always been an OF driver. Select OF in Kconfig.

There is a discrepancy between the commit message and the implemented code.
The commit message states it will "select OF", but the patch implements
"depends on OF". Could the commit message be updated to match the
implementation?

> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index dc78729ba2a5d..1590f82941ba8 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1811,7 +1811,8 @@ config M54xx_WATCHDOG
>  
>  config ATH79_WDT
>  	tristate "Atheros AR71XX/AR724X/AR913X hardware watchdog"
> -	depends on ATH79 || (ARM && COMPILE_TEST)
> +	depends on ATH79 || COMPILE_TEST
> +	depends on OF

[ ... ]

While reviewing this patch, I noticed an existing issue in the probe
function's error handling. The driver uses a global pointer to enforce a
singleton instance:

drivers/watchdog/ath79_wdt.c:ath79_wdt_probe() {
    ...
	if (wdt_base)
		return -EBUSY;

	wdt_base = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(wdt_base))
		return PTR_ERR(wdt_base);

	wdt_clk = devm_clk_get_enabled(&pdev->dev, "wdt");
	if (IS_ERR(wdt_clk))
		return PTR_ERR(wdt_clk);
    ...
}

If devm_platform_ioremap_resource() returns an error pointer, or if a
later step like devm_clk_get_enabled() returns -EPROBE_DEFER, the global
wdt_base pointer is never cleared.

Does this permanently break deferred probing and device re-binding? On a
second probe attempt, the uncleared wdt_base pointer would still evaluate
to true, causing the probe to immediately fail with -EBUSY.

Similarly, since ath79_wdt_remove() does not clear wdt_base, will unloading
and reloading the driver also fail?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260518210957.10545-1-rosenp@gmail.com?part=1

  reply	other threads:[~2026-05-18 21:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 21:09 [PATCH] watchdog: ath79_wdt: select OF and COMPILE_TEST Rosen Penev
2026-05-18 21:19 ` sashiko-bot [this message]
2026-05-18 21:38   ` Rosen Penev
2026-05-19 18:08 ` kernel test robot

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=20260518211925.A24FDC2BCB7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=rosenp@gmail.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.