From: sashiko-bot@kernel.org
To: "Markus Probst" <markus.probst@posteo.de>
Cc: robh@kernel.org, devicetree@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/5] rtc: s35390a: Add missing newline to dev_err
Date: Wed, 05 Aug 2026 20:30:37 +0000 [thread overview]
Message-ID: <20260805203037.E9A341F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260805-rtc_s35390a_int1-v3-2-e836faba3e25@posteo.de>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Desynchronization between software state and hardware 24-hour mode after initialization causes time corruption.
- [High] Alarm hour formatting erroneously adds PM bit in 24-hour mode, causing PM alarms to permanently fail.
--
--- Patch [2]: [PATCH v3 2/5] rtc: s35390a: Add missing newline to dev_err ---
commit 60df926a63720bd3dbdd3b4991c3149af682d4b0
Author: Markus Probst <markus.probst@posteo.de>
rtc: s35390a: Add missing newline to dev_err
This commit fixes a missing newline character in the dev_err call
within s35390a_probe() when alarm disabling fails.
> diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
> index b72eef4fb0997..4cfe7034c5165 100644
> --- a/drivers/rtc/rtc-s35390a.c
> +++ b/drivers/rtc/rtc-s35390a.c
> @@ -494,7 +494,7 @@ static int s35390a_probe(struct i2c_client *client)
> buf = 0;
> err = s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &buf, 1);
> if (err < 0) {
> - dev_err(dev, "error disabling alarm");
> + dev_err(dev, "error disabling alarm\n");
> return err;
> }
> } else {
While reviewing this driver, I noticed a couple of pre-existing issues.
[Severity: High]
This isn't a bug introduced by this patch, but looking at s35390a_init(),
is it possible for the software state to become desynchronized from the
hardware 24-hour mode?
drivers/rtc/rtc-s35390a.c:s35390a_init() {
...
initialize:
buf = S35390A_FLAG_RESET | S35390A_FLAG_24H;
ret = s35390a_set_reg(s35390a, S35390A_CMD_STATUS1, &buf, 1);
...
}
When this reset is triggered (for instance, via the RTC_VL_CLR ioctl or when
a brownout is detected), the hardware is explicitly switched to 24-hour mode
by setting S35390A_FLAG_24H.
However, s35390a->twentyfourhour is not updated to 1.
Does this mean subsequent calls to rtc_set_time() will incorrectly use the
12-hour formatting rules if twentyfourhour was previously 0, sending invalid
BCD formats to the chip and corrupting the timekeeping for PM hours?
[Severity: High]
This is a pre-existing issue, but I have a question about how the alarm hour
is formatted when the chip is operating in 24-hour mode:
drivers/rtc/rtc-s35390a.c:s35390a_rtc_set_alarm() {
...
buf[S35390A_ALRM_BYTE_HOURS] = s35390a_hr2reg(s35390a,
alm->time.tm_hour) | 0x80;
buf[S35390A_ALRM_BYTE_MINS] = bin2bcd(alm->time.tm_min) | 0x80;
if (alm->time.tm_hour >= 12)
buf[S35390A_ALRM_BYTE_HOURS] |= 0x40;
...
}
If the chip is in 24-hour mode, s35390a_hr2reg() will already return the
standard 24-hour BCD value (e.g., 0x15 for 15:00).
Could the unconditional bitwise-OR with 0x40 (the PM bit) corrupt the alarm
time value in 24-hour mode, causing PM alarms to permanently fail because the
hardware comparator expects a standard 24-hour BCD value?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805-rtc_s35390a_int1-v3-0-e836faba3e25@posteo.de?part=2
next prev parent reply other threads:[~2026-08-05 20:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 19:32 [PATCH v3 0/5] rtc: s35390a: Allow use of output pin for interrupt signal 1 for wakealarm Markus Probst
2026-08-05 19:32 ` [PATCH v3 1/5] dt-bindings: rtc: Add pinctrl for S35390A Markus Probst
2026-08-05 20:21 ` sashiko-bot
2026-08-05 20:32 ` Markus Probst
2026-08-07 17:23 ` Linus Walleij
2026-08-05 19:32 ` [PATCH v3 2/5] rtc: s35390a: Add missing newline to dev_err Markus Probst
2026-08-05 20:30 ` sashiko-bot [this message]
2026-08-05 19:32 ` [PATCH v3 3/5] rtc: s35390a: Fix alarm not disabling Markus Probst
2026-08-05 20:42 ` sashiko-bot
2026-08-05 19:32 ` [PATCH v3 4/5] rtc: s35390a: Add pinctrl Markus Probst
2026-08-05 20:51 ` sashiko-bot
2026-08-05 19:32 ` [PATCH v3 5/5] rtc: s35390a: Add synology quirk Markus Probst
2026-08-05 20:55 ` sashiko-bot
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=20260805203037.E9A341F000E9@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=markus.probst@posteo.de \
--cc=robh@kernel.org \
--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