From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 1/4] watchdog: qcom: Propagate errors from optional IRQ lookup
Date: Fri, 07 Aug 2026 08:25:32 +0000 [thread overview]
Message-ID: <20260807082533.2D77E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260807081652.38692-1-phucduc.bui@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The probe function aborts and returns an invalid positive value if an optional IRQ is defined but the hardware variant does not support pretimeout.
--
--- Patch [1]: [PATCH 1/4] watchdog: qcom: Propagate errors from optional IRQ lookup ---
commit 29f7b7cd8d0f4e915e9e20f6974535c663f1a3b4
Author: bui duc phuc <phucduc.bui@gmail.com>
watchdog: qcom: Propagate errors from optional IRQ lookup
This commit updates the error handling for an optional interrupt lookup
in the Qualcomm watchdog probe. Instead of only checking for -EPROBE_DEFER,
it attempts to propagate all errors except -ENXIO to better report failures.
> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
> index a425902b9f68d..2d9f79101b494 100644
> --- a/drivers/watchdog/qcom-wdt.c
> +++ b/drivers/watchdog/qcom-wdt.c
> @@ -314,8 +314,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
> wdt->wdd.info = &qcom_wdt_pt_info;
> wdt->wdd.pretimeout = 1;
> } else {
> - if (irq == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> + if (irq != -ENXIO)
> + return irq;
[Severity: High]
Will this cause the probe to fail on platforms where a valid IRQ is found
but pretimeout is disabled?
If platform_get_irq_optional() successfully finds an IRQ, it returns a
positive number. If the platform (such as APQ8064 or IPQ8064) provides an
interrupt in the device tree but the match data does not support pretimeout,
qcom_wdt_probe() execution falls into this else block.
Since the positive IRQ number does not equal -ENXIO, this condition evaluates
to true and the driver prematurely returns the positive IRQ number.
The driver core treats any non-zero return from probe as an error, which
aborts the watchdog initialization completely leaving the system without
watchdog protection.
Should this condition be scoped to only catch negative error codes, for
example by checking if (irq < 0 && irq != -ENXIO) before returning?
>
> wdt->wdd.info = &qcom_wdt_info;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260807081652.38692-1-phucduc.bui@gmail.com?part=1
next prev parent reply other threads:[~2026-08-07 8:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 8:16 [PATCH 1/4] watchdog: qcom: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-07 8:16 ` [PATCH 2/4] watchdog: mediatek: " phucduc.bui
2026-08-07 8:16 ` [PATCH 3/4] watchdog: dw_wdt: " phucduc.bui
2026-08-07 8:48 ` sashiko-bot
2026-08-07 8:16 ` [PATCH 4/4] watchdog: aspeed: " phucduc.bui
2026-08-07 8:25 ` sashiko-bot [this message]
2026-08-08 0:23 ` [PATCH 1/4] watchdog: qcom: " Guenter Roeck
2026-08-08 8:59 ` Bui Duc Phuc
2026-08-08 14:51 ` Guenter Roeck
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=20260807082533.2D77E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=phucduc.bui@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox