Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wolfram Sang" <wsa+renesas@sang-engineering.com>
Cc: wsa+renesas@sang-engineering.com, devicetree@vger.kernel.org,
	conor+dt@kernel.org, linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	robh@kernel.org
Subject: Re: [PATCH 5/6] dt-bindings: rtc: rzn1: add R-Car X5H support
Date: Mon, 14 Sep 2026 21:29:59 +0000	[thread overview]
Message-ID: <20260914212959.7E10C1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914211826.73727-13-wsa+renesas@sang-engineering.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Medium] The R-Car X5H compatible string is missing an `if-then` conditional block to explicitly disallow interrupts.

Pre-existing issues:
- [High] The driver dynamically modifies a global static `rtc_class_ops` structure during probe, causing operations to be incorrectly shared and corrupted across all device instances.
--

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

    dt-bindings: rtc: rzn1: add R-Car X5H support

This patch adds support for the R-Car X5H hardware variant to the RZ/N1 RTC
device tree binding schema. The commit message explicitly notes that this
hardware is identical to RZ/T2H except that interrupts are not wired.

> diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
> --- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
> +++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
[ ... ]
> @@ -66,6 +71,7 @@ allOf:
>              enum:
>                - renesas,r9a09g077-rtc
>                - renesas,r9a09g087-rtc
> +              - renesas,rcar-gen5-rtc
>      then:
>        properties:
>          clocks:

[Severity: Medium]
Since the commit message states that interrupts are not wired for R-Car X5H,
should there be another if-then block added to the allOf section to
explicitly restrict the interrupts property for renesas,rcar-gen5-rtc?

Without this conditional check, a device tree incorrectly defining an
interrupts property for this compatible string would silently pass schema
validation despite the hardware limitation.

While reviewing the associated driver code, I noticed a separate issue:

drivers/rtc/rtc-rzn1.c:rzn1_rtc_probe() {
[ ... ]
	if (scmp_val) {
		writel(rate - 1, rtc->base + RZN1_RTC_SCMP);
	} else {
		rzn1_rtc_ops.read_offset = rzn1_rtc_read_offset;
		rzn1_rtc_ops.set_offset = rzn1_rtc_set_offset;
	}
[ ... ]
		rzn1_rtc_ops.read_alarm = rzn1_rtc_read_alarm;
		rzn1_rtc_ops.set_alarm = rzn1_rtc_set_alarm;
		rzn1_rtc_ops.alarm_irq_enable = rzn1_rtc_alarm_irq_enable;
	}

	return devm_rtc_register_device(rtc->rtcdev);
}

[Severity: High]
This is a pre-existing issue, but does mutating the global static rzn1_rtc_ops
structure during probe cause state corruption across device instances?

If multiple RTC instances exist, devices probed subsequently that lack
certain capabilities (like no SUBU register or no alarm interrupt) will
incorrectly inherit the callbacks set by previously probed devices. Could
this lead to unhandled behavior if unsupported operations are invoked?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914211826.73727-8-wsa+renesas@sang-engineering.com?part=5

      reply	other threads:[~2026-09-14 21:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 21:18 [PATCH 0/6] rtc: rzn1: cleanups, no irq support, R-Car Gen5 enablement Wolfram Sang
2026-09-14 21:18 ` [PATCH 1/6] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
2026-09-14 21:21   ` sashiko-bot
2026-09-15  9:52   ` Lad, Prabhakar
2026-09-15 16:55   ` Conor Dooley
2026-09-14 21:18 ` [PATCH 2/6] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
2026-09-14 21:20   ` sashiko-bot
2026-09-15  9:52   ` Lad, Prabhakar
2026-09-15 16:55   ` Conor Dooley
2026-09-14 21:18 ` [PATCH 3/6] dt-bindings: rtc: rzn1: interrupts are not required Wolfram Sang
2026-09-14 21:29   ` sashiko-bot
2026-09-15  9:55   ` Lad, Prabhakar
2026-09-15 16:54     ` Conor Dooley
2026-09-16  7:32       ` Wolfram Sang
2026-09-14 21:18 ` [PATCH 5/6] dt-bindings: rtc: rzn1: add R-Car X5H support Wolfram Sang
2026-09-14 21:29   ` 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=20260914212959.7E10C1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=robh@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