Linux Watchdog driver development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Shiv Prakash Gupta" <shivprakash.gupta@nxp.com>,
	linux-rtc@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v5 3/4] rtc: pcf8525: Add watchdog support
Date: Thu, 26 Nov 2026 07:26:07 +0000	[thread overview]
Message-ID: <sashiko-outbox-234953@kernel.org> (raw)
In-Reply-To: <20261126071124.2383368-4-shivprakash.gupta@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] rtc: pcf8525: probe failure in pcf8525_get_intb_irq() on
  single-IRQ DT nodes
--

commit 30bd2f8be3e00c36f24f374f227c2546b036b58f
Author: Shiv Prakash Gupta <shivprakash.gupta@nxp.com>

rtc: pcf8525: Add watchdog support

This commit adds optional alarm-only watchdog support to the NXP PCF8525
RTC driver using the INTB interrupt line.

> diff --git a/drivers/rtc/rtc-pcf8525.c b/drivers/rtc/rtc-pcf8525.c
> index 2b23b17d6750c..25420e7ad21c8 100644
> --- a/drivers/rtc/rtc-pcf8525.c
> +++ b/drivers/rtc/rtc-pcf8525.c

[ ... ]

> @@ -719,6 +978,31 @@ static int pcf8525_get_inta_irq(struct i2c_client *client)
>  	return client->irq;
>  }
>  
> +static int pcf8525_get_intb_irq(struct i2c_client *client)
> +{
> +	struct fwnode_handle *fwnode = dev_fwnode(&client->dev);
> +	int irq;
> +
> +	irq = fwnode_irq_get_byname(fwnode, "intb");
> +	if (irq >= 0 || irq == -EPROBE_DEFER)
> +		return irq;
> +
> +	if (irq != -ENOENT && irq != -EINVAL && irq != -ENODATA &&
> +	    irq != -ENXIO)
> +		return irq;
> +
> +	if (fwnode_property_present(fwnode, "interrupt-names"))
> +		return 0;
> +
> +	/* With no interrupt-names, INTB is the optional second interrupt. */
> +	irq = fwnode_irq_get(fwnode, 1);
> +	if (irq == -ENOENT || irq == -EINVAL || irq == -ENODATA ||
> +	    irq == -ENXIO)
> +		return 0;
> +
> +	return irq;
> +}

[Severity: High]
Does fwnode_irq_get(fwnode, 1) fail pcf8525_probe() on Device Tree nodes
that specify a single interrupt without interrupt-names?

When the interrupts property has only one entry, fwnode_irq_get() ->
of_fwnode_irq_get() -> of_irq_get() -> of_irq_parse_one() ->
of_property_read_u32_index() -> of_find_property_value_of_size() returns
-EOVERFLOW because the property exists on the node with a length smaller
than index 1 requires.  Since -EOVERFLOW is not mapped to 0 here,
pcf8525_get_intb_irq() returns -EOVERFLOW and aborts pcf8525_probe().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126071124.2383368-1-shivprakash.gupta@nxp.com?part=3

  reply	other threads:[~2026-11-26  7:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  7:11 [PATCH v5 0/4] rtc: Add NXP PCF8525 RTC support Shiv Prakash Gupta
2026-11-26  7:11 ` [PATCH v5 1/4] dt-bindings: rtc: Add NXP PCF8525 RTC Shiv Prakash Gupta
2026-11-26  7:11 ` [PATCH v5 2/4] rtc: pcf8525: Add NXP PCF8525 RTC driver Shiv Prakash Gupta
2026-11-26  7:30   ` sashiko-bot
2026-11-26  7:11 ` [PATCH v5 3/4] rtc: pcf8525: Add watchdog support Shiv Prakash Gupta
2026-11-26  7:26   ` sashiko-bot [this message]
2026-11-26  7:11 ` [PATCH v5 4/4] rtc: pcf8525: Add temperature sensor support via hwmon Shiv Prakash Gupta

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=sashiko-outbox-234953@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shivprakash.gupta@nxp.com \
    /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