From: sashiko-bot@kernel.org
To: "Sander Speetjens" <sander.speetjens@gmail.com>
Cc: robh@kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH v5 2/2] rtc: Add Raspberry Pi 5 RTC driver
Date: Thu, 24 Sep 2026 13:34:27 +0000 [thread overview]
Message-ID: <20260924133427.99DFF1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260924132217.1281752-3-sander.speetjens@gmail.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] rtc: raspberrypi: Missing endianness conversion in firmware communication
- [Medium] rtc: raspberrypi: Incorrect DT node for trickle voltage property
- [Medium] rtc: raspberrypi: Missing MODULE_ALIAS prevents autoloading
--
commit 2afa604e9b62ac37552a0a69c5399fed7850a086
Author: Sander Speetjens <sander.speetjens@gmail.com>
rtc: Add Raspberry Pi 5 RTC driver
Upstreaming the downstream Raspberry Pi 5 RTC driver. This driver supports
the custom DA9091, which is accessed through the firmware mailbox.
> diff --git a/drivers/rtc/rtc-raspberrypi.c b/drivers/rtc/rtc-raspberrypi.c
> new file mode 100644
> index 0000000000000..494b949374064
> --- /dev/null
> +++ b/drivers/rtc/rtc-raspberrypi.c
[ ... ]
> +static int rpi_rtc_read_time(struct device *dev, struct rtc_time *tm)
> +{
> + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev);
> + u32 data[2] = { RTC_TIME };
> + int err;
> +
> + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG,
> + &data, sizeof(data));
> + rtc_time64_to_tm(data[1], tm);
[Severity: High]
Will this driver run correctly on big-endian kernels?
The raw payload returned by the firmware is treated as host-endian here. If
the firmware expects and returns little-endian payloads (as is common for
mailbox interfaces), should this code use le32_to_cpu() to prevent byte
transposition issues?
> + return err;
> +}
> +
> +static int rpi_rtc_set_time(struct device *dev, struct rtc_time *tm)
> +{
> + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev);
> + u32 data[2] = { RTC_TIME, rtc_tm_to_time64(tm) };
[Severity: High]
Similar to rpi_rtc_read_time(), the timestamp and sub-command are placed
into a host-endian u32 array without conversion.
Should this value be converted to little-endian using cpu_to_le32() before
sending it to the firmware?
> +
> + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG,
> + &data, sizeof(data));
> +}
[ ... ]
> +static int rpi_rtc_probe(struct platform_device *pdev)
> +{
[ ... ]
> + vrtc->rtc->ops = &rpi_rtc_ops;
> +
> + rpi_rtc_alarm_clear_pending(dev);
> +
> + vrtc->bbat_vchg_millivolts = 0;
> + of_property_read_u32(dev->parent->of_node, "trickle-voltage-millivolt",
> + &vrtc->bbat_vchg_millivolts);
[Severity: Medium]
Does this read the property from the correct device tree node?
It appears this reads trickle-voltage-millivolt from the parent firmware
node (dev->parent->of_node) instead of the child RTC node. If a correct
device tree specifies this property on the RTC node to follow DT encapsulation
rules, will that configuration be ignored here?
> +
> + rpi_rtc_set_limits(dev);
> + rpi_rtc_set_charge_voltage(dev);
> +
> + return devm_rtc_register_device(vrtc->rtc);
> +}
> +
> +static const struct of_device_id rpi_rtc_dt_match[] = {
> + { .compatible = "raspberrypi,firmware-rtc" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, rpi_rtc_dt_match);
> +
> +static struct platform_driver rpi_rtc_driver = {
> + .driver = {
> + .name = "raspberrypi-rtc",
> + .of_match_table = of_match_ptr(rpi_rtc_dt_match),
> + },
> + .probe = rpi_rtc_probe
> +};
[Severity: Medium]
Will this module autoload correctly on systems using manual registration?
The firmware driver registers a platform device named raspberrypi-rtc, which
generates a platform:raspberrypi-rtc uevent. Without a matching MODULE_ALIAS
declaration here, it seems udev might not be able to match the fallback
device to the driver module.
> +
> +module_platform_driver(rpi_rtc_driver);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260924132217.1281752-1-sander.speetjens@gmail.com?part=2
prev parent reply other threads:[~2026-09-24 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 13:22 [PATCH v5 0/2] Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-24 13:22 ` [PATCH v5 1/2] dt-bindings: rtc: Add property for Raspberry Pi 5 RTC Sander Speetjens
2026-09-24 13:28 ` sashiko-bot
2026-09-24 16:27 ` Conor Dooley
2026-09-24 13:22 ` [PATCH v5 2/2] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-24 13:34 ` 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=20260924133427.99DFF1F000FF@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=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 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.