From: sashiko-bot@kernel.org
To: "Sasha Levin" <sashal@kernel.org>
Cc: linux-rtc@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH AUTOSEL 6.18-5.10] rtc: bq32000: add delay between RTC reads
Date: Mon, 31 Aug 2026 16:15:14 +0000 [thread overview]
Message-ID: <20260831161514.A3CF31F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260831133314.4125787-423-sashal@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The delay workaround is bypassed if `client->irq > 0`, but because the driver lacks IRQ handling, userspace will always poll and trigger the hardware bug.
--
commit 50c036b36c688887d406f6107b0ade6653a75e5c
Author: Adriana Stancu <adriana@arista.com>
rtc: bq32000: add delay between RTC reads
This patch adds a delay before reading the BQ32000 RTC registers to prevent
stale reads or select timeouts during aggressive polling. The hardware needs
idle time to refresh its register buffer, which is starved when tools like
hwclock continuously poll on systems without an interrupt line.
Link: https://patch.msgid.link/20260416142151.3385827-1-adriana@arista.com
> diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
> index 7ad34539be4d2..245e5e45d6a16 100644
> --- a/drivers/rtc/rtc-bq32k.c
> +++ b/drivers/rtc/rtc-bq32k.c
[ ... ]
> @@ -89,9 +90,17 @@ static int bq32k_write(struct device *dev, void *data, uint8_t off, uint8_t len)
>
> static int bq32k_rtc_read_time(struct device *dev, struct rtc_time *tm)
> {
> + struct i2c_client *client = to_i2c_client(dev);
> struct bq32k_regs regs;
> int error;
>
> + /*
> + * When the device doesn't have the interrupt connected, prevent
> + * userpace from polling the RTC registers too frequently.
> + */
> + if (client->irq <= 0)
[Severity: Medium]
Will this condition incorrectly skip the delay workaround on systems that have
an interrupt defined in the device tree?
Because the BQ32000 driver itself lacks IRQ handling (RTC_FEATURE_ALARM is not
set and no alarm_irq_enable callback exists), the RTC core will always fall
back to UIE emulation. This emulation aggressively polls rtc_read_time()
regardless of whether client->irq > 0.
If client->irq > 0, the workaround is bypassed, but the hardware is still
subject to the exact same aggressive polling from userspace. Does this leave
these systems vulnerable to the same hardware register lockup (stale reads and
select timeouts) that this patch intends to fix?
> + usleep_range(2000, 2500);
> +
> error = bq32k_read(dev, ®s, 0, sizeof(regs));
> if (error)
> return error;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260831133314.4125787-423-sashal@kernel.org?part=1
next prev parent reply other threads:[~2026-08-31 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260831133314.4125787-1-sashal@kernel.org>
2026-08-31 13:23 ` [PATCH AUTOSEL 6.18-5.10] rtc: aspeed: add AST2700 compatible Sasha Levin
2026-08-31 14:41 ` sashiko-bot
2026-08-31 13:25 ` [PATCH AUTOSEL 6.18] rtc: renesas-rtca3: Check RADJ poll result during initial setup Sasha Levin
2026-08-31 15:30 ` sashiko-bot
2026-08-31 13:27 ` [PATCH AUTOSEL 6.18-5.10] rtc: bq32000: add delay between RTC reads Sasha Levin
2026-08-31 16:15 ` sashiko-bot [this message]
2026-08-31 13:28 ` [PATCH AUTOSEL 6.18-6.12] rtc: mv: add suspend/resume support for wakeup Sasha Levin
2026-08-31 16:35 ` 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=20260831161514.A3CF31F00A3E@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-rtc@vger.kernel.org \
--cc=sashal@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