From: sashiko-bot@kernel.org
To: "Markus Probst" <markus.probst@posteo.de>
Cc: linux-rtc@vger.kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v9 3/6] rtc: s35390a: Fix alarm not disabling
Date: Wed, 16 Sep 2026 16:13:08 +0000 [thread overview]
Message-ID: <20260916161308.EE1051F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260916-rtc_s35390a_int1-v9-3-b2567a3e4959@posteo.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] rtc: s35390a: unhandled interrupt storm in alarm_irq_enable()
--
commit f08c593edb80ced466b342983365673dd8bdb4ee
Author: Markus Probst <markus.probst@posteo.de>
rtc: s35390a: Fix alarm not disabling
Implement alarm_irq_enable callback.
> diff --git a/drivers/rtc/rtc-s35390a.c b/drivers/rtc/rtc-s35390a.c
> index 4cfe7034c5165..575bb256eb258 100644
> --- a/drivers/rtc/rtc-s35390a.c
> +++ b/drivers/rtc/rtc-s35390a.c
> @@ -270,6 +270,24 @@ static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
> return 0;
> }
>
> +static int s35390a_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
> +{
> + struct s35390a *s35390a = dev_get_drvdata(dev);
> + u8 sts;
> + int err;
> +
> + if (enabled)
> + sts = S35390A_INT2_MODE_ALARM;
> + else
> + sts = S35390A_INT2_MODE_NOINTR;
> +
> + err = s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &sts, sizeof(sts));
[Severity: High]
Does this code risk causing an unhandled interrupt storm if a previous alarm
was pending?
The S-35390A hardware holds the alarm interrupt flag in STATUS1 until it is
explicitly read. If a previous alarm fired and STATUS1 was not read, the flag
remains set.
When userspace calls ioctl(RTC_AIE_ON), the RTC core directly invokes
s35390a_rtc_alarm_irq_enable(1) without calling .set_alarm(). Writing to
STATUS2 enables the INT2 alarm output, but without first reading STATUS1 to
clear any pending interrupt, the hardware will immediately assert the INT2 pin
if the flag is still set.
Because the driver has no runtime ISR to acknowledge the interrupt, could the
pin remain asserted indefinitely and prevent the system from sleeping or
disable shared IRQ lines?
> + if (err < 0)
> + return err;
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-rtc_s35390a_int1-v9-0-b2567a3e4959@posteo.de?part=3
next prev parent reply other threads:[~2026-09-16 16:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 16:00 [PATCH v9 0/6] rtc: s35390a: Allow use of output pin for interrupt signal 1 for wakealarm Markus Probst
2026-09-16 16:00 ` [PATCH v9 1/6] dt-bindings: rtc: Add pinctrl for S35390A Markus Probst
2026-09-16 16:07 ` sashiko-bot
2026-09-24 22:02 ` Rob Herring
2026-09-16 16:00 ` [PATCH v9 2/6] rtc: s35390a: Add missing newline to dev_err Markus Probst
2026-09-16 16:04 ` sashiko-bot
2026-09-16 16:00 ` [PATCH v9 3/6] rtc: s35390a: Fix alarm not disabling Markus Probst
2026-09-16 16:13 ` sashiko-bot [this message]
2026-09-16 16:00 ` [PATCH v9 4/6] rtc: s35390a: Read 24-hour mode on access Markus Probst
2026-09-16 16:10 ` sashiko-bot
2026-09-16 16:00 ` [PATCH v9 5/6] rtc: s35390a: Add pinctrl Markus Probst
2026-09-16 16:12 ` sashiko-bot
2026-09-16 16:00 ` [PATCH v9 6/6] rtc: s35390a: Add synology quirk Markus Probst
2026-09-16 16:05 ` 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=20260916161308.EE1051F00893@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