Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions patch/0018-drivers-rtc-handle-OTF-clock-changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From 2415aef978513606be09aff401ed4ee32fc2a0df Mon Sep 17 00:00:00 2001
From: Elad Nachman <enachman@marvell.com>
Date: Mon, 15 Jun 2026 10:58:42 +0000
Subject: [PATCH] drivers: rtc: handle OTF clock changes

When processing expired RTC events and rearming them, use now
instead of expiry to prevent endless loops.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a Fixes: tag, and also list the devices in the commit message.

Signed-off-by: Elad Nachman <enachman@marvell.com>
---
drivers/rtc/interface.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 04ce689da..eb1338b97 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -126,6 +126,7 @@ EXPORT_SYMBOL_GPL(rtc_read_time);
int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
{
int err, uie;
+ struct rtc_time new_tm;

err = rtc_valid_tm(tm);
if (err != 0)
@@ -159,6 +160,17 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
else
err = -EINVAL;

+ if (rtc && rtc->ops && rtc->ops->read_time) {
+ if (!rtc->ops->read_time(rtc->dev.parent, &new_tm)) {
+ pr_err("new rtc tm %d %d %d %d %d %d %d %d %d\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-write. Currently it’s more like a debug message. (Which is good to have.)

+ new_tm.tm_sec, new_tm.tm_min,
+ new_tm.tm_hour, new_tm.tm_mday,
+ new_tm.tm_mon, new_tm.tm_year,
+ new_tm.tm_wday, new_tm.tm_yday,
+ new_tm.tm_isdst);
+ }
+ }
+
pm_stay_awake(rtc->dev.parent);
mutex_unlock(&rtc->ops_lock);
/* A timer might have just expired */
@@ -932,7 +944,7 @@ void rtc_timer_do_work(struct work_struct *work)
trace_rtc_timer_fired(timer);
/* Re-add/fwd periodic timers */
if (ktime_to_ns(timer->period)) {
- timer->node.expires = ktime_add(timer->node.expires,
+ timer->node.expires = ktime_add(now/*timer->node.expires*/,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have git, so commenting this out is not useful.

timer->period);
timer->enabled = 1;
timerqueue_add(&rtc->timerqueue, &timer->node);
--
2.25.1

1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ cisco-npu-disable-other-bars.patch
0015-arm64-dts-marvell-Add-Supermicro-SSE-G3748-board.patch
0016-arm64-dts-marvell-Add-Wistron-ES-1227-54TS-board.patch
0017-Extend-driver-to-support-XMC-XM25QH256C-device.patch
0018-drivers-rtc-handle-OTF-clock-changes.patch

# amd-pensando elba support
0000-Add-support-for-the-TI-TPS53659.patch
Expand Down