From: sashiko-bot@kernel.org
To: "Sander Speetjens" <sander.speetjens@gmail.com>
Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v11 3/3] rtc: Add Raspberry Pi 5 RTC driver
Date: Wed, 14 Oct 2026 08:42:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-171032@kernel.org> (raw)
In-Reply-To: <20261014083016.332338-4-sander.speetjens@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] rtc: rpi: missing alarm pending clear outside probe
- [Low] core: Unused variable `firmware` in rpi_register_rtc_driver()
--
commit fd3eb73150bb8312044bd5332b80f44be6ed81ec
Author: Sander Speetjens <sander.speetjens@gmail.com>
rtc: Add Raspberry Pi 5 RTC driver
This commit upstreams the downstream Raspberry Pi 5 RTC driver. It adds
support for the custom DA9091, which is accessed through the firmware mailbox.
> diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
> index 0aa322e9a2e73..b22c59a429dea 100644
> --- a/drivers/firmware/raspberrypi.c
> +++ b/drivers/firmware/raspberrypi.c
[ ... ]
> @@ -231,6 +232,27 @@ static void rpi_register_clk_driver(struct device *dev)
> -1, NULL, 0);
> }
>
> +static void rpi_register_rtc_driver(struct device *dev)
> +{
> + struct platform_device *pdev;
> + struct device_node *firmware;
[Severity: Low]
Is the firmware variable needed here? It appears to be declared but
never used in rpi_register_rtc_driver(), which will trigger a
-Wunused-variable compiler warning and fail builds configured with -Werror.
> +
> + /*
> + * Check if our model of Raspberry Pi board is from the 5th gen
> + * as the RTC is only present on that model.
> + */
> + if (!of_machine_is_compatible("brcm,bcm2712"))
> + return;
[ ... ]
> diff --git a/drivers/rtc/rtc-raspberrypi.c b/drivers/rtc/rtc-raspberrypi.c
> new file mode 100644
> index 0000000000000..6d5c8111f4db6
> --- /dev/null
> +++ b/drivers/rtc/rtc-raspberrypi.c
[ ... ]
> +static int rpi_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
> +{
> + struct rpi_rtc_data *rtc = dev_get_drvdata(dev);
> + struct rpi_rtc_reg data = {
> + .reg = cpu_to_le32(RTC_ALARM),
> + .val = cpu_to_le32(rtc_tm_to_time64(&alarm->time))
> + };
> + int err;
> +
> + err = rpi_firmware_property(rtc->fw, RPI_FIRMWARE_SET_RTC_REG,
> + &data, sizeof(data));
> +
> + if (!err)
> + err = rpi_rtc_alarm_irq_enable(dev, alarm->enabled);
[Severity: Medium]
Should we explicitly clear the alarm pending bit when setting a new alarm?
rpi_rtc_alarm_clear_pending() is called once during rpi_rtc_probe(), but
the pending state does not seem to be cleared when new alarms are set
here or during a resume path. If an alarm triggers while the system is
awake (or if the system uses S2idle/S3 suspend where probe is not re-run),
could the lingering pending bit prevent subsequent wake alarms from firing
or cause immediate spurious wakeups?
> +
> + return err;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014083016.332338-1-sander.speetjens@gmail.com?part=3
prev parent reply other threads:[~2026-10-14 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 8:30 [PATCH v11 0/3] Raspberry Pi 5 RTC driver Sander Speetjens
2026-10-14 8:30 ` [PATCH v11 1/3] dt-bindings: rtc: Add missing type to trickle-voltage-millivolt Sander Speetjens
2026-10-14 8:30 ` [PATCH v11 2/3] dt-bindings: rtc: Add property for Raspberry Pi 5 RTC Sander Speetjens
2026-10-14 17:28 ` Alexandre Belloni
2026-10-14 8:30 ` [PATCH v11 3/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens
2026-10-14 8:42 ` 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=sashiko-outbox-171032@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=sander.speetjens@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