Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wolfram Sang" <wsa+renesas@sang-engineering.com>
Cc: linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v3 4/4] rtc: rzn1: add R-Car X5H support
Date: Thu, 17 Sep 2026 11:25:27 +0000	[thread overview]
Message-ID: <20260917112528.36BB51F00899@smtp.kernel.org> (raw)
In-Reply-To: <20260917111349.52250-5-wsa+renesas@sang-engineering.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] rtc: rzn1: falsely advertising RTC_FEATURE_UPDATE_INTERRUPT for broken_irqs
--

commit 526064073abaf5e11d2cc3b65e8bf7e6092cd549
Author: Wolfram Sang <wsa+renesas@sang-engineering.com>

rtc: rzn1: add R-Car X5H support

The RTC on R-Car X5H is a bit special because interrupts are not wired.
This creates a dedicated entry for X5H without interrupts.

> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c

[ ... ]

> @@ -504,25 +506,39 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>  
>  	spin_lock_init(&rtc->ctl1_access_lock);
>  
> -	ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> -	if (ret)
> -		return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> -
> -	irq = platform_get_irq_byname_optional(pdev, "pps");
> -	if (irq == -EPROBE_DEFER)
> -		return irq;
> -	if (irq >= 0)
> -		ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> -
> -	if (irq < 0 || ret) {
> -		set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> -		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> -		dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +	if (data->broken_irqs) {
> +		/* All known broken irqs are on SCMP only variants */
> +		rtc->rtcdev->ops = &rzn1_rtc_ops_scmp_no_alarm;
> +	} else {

[Severity: Medium]
Does this branch need to clear the RTC_FEATURE_UPDATE_INTERRUPT bit from
rtc->rtcdev->features?

Since devm_rtc_allocate_device() allocates the RTC device and
unconditionally sets RTC_FEATURE_UPDATE_INTERRUPT, drivers that do not
support hardware update interrupts are expected to clear this bit.

The original code cleared this bit when PPS interrupts were missing, but
this new branch for broken_irqs skips that clearing logic.

Could this expose false hardware capabilities to userspace when queried
via RTC_PARAM_FEATURES?

> +		irq = platform_get_irq_byname(pdev, "alarm");
> +		if (irq < 0)
> +			return irq;
> +
> +		ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> +		if (ret)
> +			return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> +
> +		irq = platform_get_irq_byname_optional(pdev, "pps");
> +		if (irq == -EPROBE_DEFER)
> +			return irq;
> +		if (irq >= 0)
> +			ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> +
> +		if (irq < 0 || ret) {
> +			set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> +			clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> +			dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +		}
>  	}
>  
>  	return devm_rtc_register_device(rtc->rtcdev);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260917111349.52250-1-wsa+renesas@sang-engineering.com?part=4

  reply	other threads:[~2026-09-17 11:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 11:13 [PATCH v3 0/4] rtc: rzn1: cleanups, R-Car X5H enablement Wolfram Sang
2026-09-17 11:13 ` [PATCH v3 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
2026-09-17 11:17   ` sashiko-bot
2026-09-17 11:13 ` [PATCH v3 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
2026-09-17 11:16   ` sashiko-bot
2026-09-17 11:13 ` [PATCH v3 3/4] dt-bindings: rtc: rzn1: add R-Car X5H support Wolfram Sang
2026-09-17 11:19   ` sashiko-bot
2026-09-17 12:35   ` Geert Uytterhoeven
2026-09-24 22:17   ` Rob Herring (Arm)
2026-09-25  7:43   ` Geert Uytterhoeven
2026-09-27 16:14     ` Wolfram Sang
2026-09-28  8:36       ` Geert Uytterhoeven
2026-09-17 11:13 ` [PATCH v3 4/4] " Wolfram Sang
2026-09-17 11:25   ` sashiko-bot [this message]
2026-09-17 12:38   ` Geert Uytterhoeven

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=20260917112528.36BB51F00899@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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