From: sashiko-bot@kernel.org
To: "Wolfram Sang" <wsa+renesas@sang-engineering.com>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, wsa+renesas@sang-engineering.com
Subject: Re: [PATCH 6/6] rtc: rzn1: add R-Car X5H support
Date: Mon, 14 Sep 2026 21:28:30 +0000 [thread overview]
Message-ID: <20260914212830.A65031F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914211826.73727-14-wsa+renesas@sang-engineering.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] rzn1_rtc_probe() dynamically modifies the static global rzn1_rtc_ops struct, which causes state corruption if the driver is unbound and rebound or if multiple device instances exist.
Pre-existing issues:
- [High] rzn1_rtc_set_offset() fails to clear the hardware offset when the requested offset is 0, leaving the previous offset stuck in hardware.
--
commit c04fb139b5ae435fea49907420111efaa4083c83
Author: Wolfram Sang <wsa+renesas@sang-engineering.com>
rtc: rzn1: add R-Car X5H support
This commit adds the compatible string for the Renesas R-Car X5H RTC to
the rzn1 driver.
> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index 583ce12b052d9..5860ecef428a6 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c
> @@ -527,6 +527,7 @@ static const struct rzn1_rtc_data rzn1_rtc_rzn1_data = {
>
> static const struct of_device_id rzn1_rtc_of_match[] = {
> { .compatible = "renesas,r9a09g077-rtc", .data = &rzn1_rtc_rzt2h_data },
> + { .compatible = "renesas,rcar-gen5-rtc", .data = &rzn1_rtc_rzt2h_data },
[Severity: High]
Does dynamically modifying the static global rzn1_rtc_ops struct in
rzn1_rtc_probe() cause a regression where state is corrupted if multiple
device instances exist or if the driver is unbound and rebound?
If a device with alarms is probed, the global struct is modified:
drivers/rtc/rtc-rzn1.c:rzn1_rtc_probe() {
...
if (irq >= 0) {
...
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;
}
...
}
If the driver is subsequently bound to a device without alarms (like R-Car
X5H, as introduced by this patch), the global struct incorrectly retains
the alarm callbacks. The RTC subsystem will then expose non-existent alarm
capabilities to userspace.
[Severity: High]
This is a pre-existing issue, but does rzn1_rtc_set_offset() fail to clear
the hardware offset when the requested offset is 0?
If a user configures a non-zero offset and subsequently attempts to clear
it by setting it to 0, the function exits before updating the hardware
register:
drivers/rtc/rtc-rzn1.c:rzn1_rtc_set_offset() {
...
if (!steps)
return 0;
...
writel(subu, rtc->base + RZN1_RTC_SUBU);
...
}
This early return leaves the previous offset permanently active in hardware.
> { .compatible = "renesas,rzn1-rtc", .data = &rzn1_rtc_rzn1_data },
> { /* sentinel */ }
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914211826.73727-8-wsa+renesas@sang-engineering.com?part=6
prev parent reply other threads:[~2026-09-14 21:28 UTC|newest]
Thread overview: 21+ 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 4/6] rtc: rzn1: make interrupts optional Wolfram Sang
2026-09-14 21:29 ` sashiko-bot
2026-09-15 9:17 ` 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
2026-09-14 21:18 ` [PATCH 6/6] " Wolfram Sang
2026-09-14 21:28 ` 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=20260914212830.A65031F000FF@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 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.