* [PATCH] rtc: interface: fix wakeup source leak in rtc_timer_do_work()
@ 2026-11-12 0:21 Jesse Casco
2026-11-12 0:45 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Jesse Casco @ 2026-11-12 0:21 UTC (permalink / raw)
To: Alexandre Belloni; +Cc: linux-rtc, linux-kernel
rtc_update_irq(), rtc_set_time() and the -ETIME paths of
rtc_timer_enqueue() and rtc_timer_remove() call pm_stay_awake() on the
RTC parent device before scheduling rtc->irqwork, and
rtc_timer_do_work() balances that with pm_relax() when it is done.
Since commit e8ba8a2bc4f6 ("rtc: check if __rtc_read_time was successful
in rtc_timer_do_work()"), a failed time read returns early without
calling pm_relax(). A single read error then leaves the wakeup source
active, reads of /sys/power/wakeup_count block and suspend cannot
proceed.
Seen on an ASUS Zenbook A16 (UX3607OA), where reads of the PMIC GLINK
RTC time out and the pmic_glink.rtc-glink.0 wakeup source stays active
from boot. With this change the source is released after each failed
read.
Fixes: e8ba8a2bc4f6 ("rtc: check if __rtc_read_time was successful in rtc_timer_do_work()")
Cc: stable@vger.kernel.org
Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
---
drivers/rtc/interface.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 96626f8068f9..ba4f92ac0f89 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -980,6 +980,7 @@ void rtc_timer_do_work(struct work_struct *work)
again:
err = __rtc_read_time(rtc, &tm);
if (err) {
+ pm_relax(rtc->dev.parent);
mutex_unlock(&rtc->ops_lock);
return;
}
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] rtc: interface: fix wakeup source leak in rtc_timer_do_work()
2026-11-12 0:21 [PATCH] rtc: interface: fix wakeup source leak in rtc_timer_do_work() Jesse Casco
@ 2026-11-12 0:45 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-12 0:45 UTC (permalink / raw)
To: Jesse Casco; +Cc: linux-rtc, Alexandre Belloni
> rtc_update_irq(), rtc_set_time() and the -ETIME paths of
> rtc_timer_enqueue() and rtc_timer_remove() call pm_stay_awake() on the
> RTC parent device before scheduling rtc->irqwork, and
> rtc_timer_do_work() balances that with pm_relax() when it is done.
>
> Since commit e8ba8a2bc4f6 ("rtc: check if __rtc_read_time was successful
> in rtc_timer_do_work()"), a failed time read returns early without
> calling pm_relax(). A single read error then leaves the wakeup source
> active, reads of /sys/power/wakeup_count block and suspend cannot
> proceed.
>
> Seen on an ASUS Zenbook A16 (UX3607OA), where reads of the PMIC GLINK
> RTC time out and the pmic_glink.rtc-glink.0 wakeup source stays active
> from boot. With this change the source is released after each failed
> read.
>
> Fixes: e8ba8a2bc4f6 ("rtc: check if __rtc_read_time was successful in rtc_timer_do_work()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jesse Casco <jesse.casco@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112002125.24566-1-jesse.casco@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-12 0:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 0:21 [PATCH] rtc: interface: fix wakeup source leak in rtc_timer_do_work() Jesse Casco
2026-11-12 0:45 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox