From: sashiko-bot@kernel.org
To: "Antoni Pokusinski" <apokusinski01@gmail.com>
Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 4/9] rtc: abx80x: properly handle shared IRQs
Date: Tue, 11 Aug 2026 19:53:03 +0000 [thread overview]
Message-ID: <20260811195303.CD7301F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260811194034.28937-5-apokusinski01@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The write to the Oscillator Control Register (ABX8XX_REG_OSC) in `abx80x_probe` is silently ignored by the hardware because the required configuration key (`ABX8XX_CFG_KEY_OSC`) is not written to the Configuration Key Register beforehand. If the RTC has previously enabled interrupts like Auto Calibration or Oscillator Fail (e.g., from the bootloader or prior system state), they will remain enabled. When these interrupts trigger, the newly modified `abx80x_handle_irq` returns `IRQ_NONE` without clearing the interrupt status bits, leading to an interrupt storm that will eventually cause the kernel to disable the shared IRQ line.
--
--- Patch [4]: [PATCH v5 4/9] rtc: abx80x: properly handle shared IRQs ---
commit 7460b93d807b8ac0b8ec90945bfa5691c0f9cd26
Author: Antoni Pokusinski <apokusinski01@gmail.com>
rtc: abx80x: properly handle shared IRQs
This patch modifies the abx80x interrupt handler to support shared IRQs by
only returning IRQ_HANDLED when alarm or watchdog events occur. It also
updates the probe function to disable unused interrupts.
> diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
> index 0c8d3416fd5a9..485d1ea08030d 100644
> --- a/drivers/rtc/rtc-abx80x.c
> +++ b/drivers/rtc/rtc-abx80x.c
[ ... ]
> @@ -950,6 +963,37 @@ static int abx80x_probe(struct i2c_client *client)
> if (err)
> return err;
>
> + /* Disable unused interrupts */
[ ... ]
> + data = i2c_smbus_read_byte_data(client, ABX8XX_REG_OSC);
> + if (data < 0) {
> + dev_err(&client->dev, "Unable to read Oscillator Control register\n");
> + return -EIO;
> + }
> +
> + err = i2c_smbus_write_byte_data(client, ABX8XX_REG_OSC,
> + data & ~(ABX8XX_OSC_ACIE |
> + ABX8XX_OSC_OFIE));
[Severity: High]
Will this write to ABX8XX_REG_OSC be silently ignored by the hardware?
It appears that writing to the Oscillator Control Register requires an unlock
key to be written to the Configuration Key Register first.
If this write fails and the RTC was previously left with ACIE or OFIE
interrupts enabled (e.g., from the bootloader), could it lead to an interrupt
storm?
When those interrupts fire, the updated abx80x_handle_irq() will now skip
them and return IRQ_NONE without clearing the status bits:
if (status & ABX8XX_STATUS_AF) {
rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF);
handled = IRQ_HANDLED;
}
...
if (handled == IRQ_HANDLED)
i2c_smbus_write_byte_data(client, ABX8XX_REG_STATUS,
status & ~(ABX8XX_STATUS_AF | ABX8XX_STATUS_WDT));
return handled;
Since the status bits are not cleared for unhandled events, the IRQ controller
would continually retrigger and eventually disable the shared IRQ line.
> + if (err < 0) {
> + dev_err(&client->dev, "Unable to write Oscillator Control register\n");
> + return -EIO;
> + }
> +
> if (client->irq > 0) {
> dev_info(&client->dev, "IRQ %d supplied\n", client->irq);
> err = devm_request_threaded_irq(&client->dev, client->irq, NULL,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260811194034.28937-1-apokusinski01@gmail.com?part=4
next prev parent reply other threads:[~2026-08-11 19:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 19:40 [PATCH v5 0/9] rtc: abx80x: add support for abx81x Antoni Pokusinski
2026-08-11 19:40 ` [PATCH v5 1/9] dt-bindings: rtc: abx80x: document ABX81X RTCs Antoni Pokusinski
2026-08-11 19:48 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 2/9] rtc: abx80x: fix error check after i2c_smbus_read in read_alarm() Antoni Pokusinski
2026-08-11 19:55 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 3/9] rtc: abx80x: add mutex protection for register writes Antoni Pokusinski
2026-08-11 19:56 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 4/9] rtc: abx80x: properly handle shared IRQs Antoni Pokusinski
2026-08-11 19:53 ` sashiko-bot [this message]
2026-08-11 19:40 ` [PATCH v5 5/9] rtc: abx80x: add irq to struct abx80x_priv Antoni Pokusinski
2026-08-11 19:51 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 6/9] rtc: abx80x: use regmap instead of I2C specific API Antoni Pokusinski
2026-08-11 19:55 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 7/9] rtc: abx80x: replace read-modify-write pattern with regmap helpers Antoni Pokusinski
2026-08-11 19:56 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 8/9] rtc: abx80x: create abx80x_i2c_probe() Antoni Pokusinski
2026-08-11 19:54 ` sashiko-bot
2026-08-11 19:40 ` [PATCH v5 9/9] rtc: abx80x: add support for ABX81X Antoni Pokusinski
2026-08-11 20:03 ` 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=20260811195303.CD7301F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=apokusinski01@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--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 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.