drivers/rtc: fix rcu unexpected reboot#592
Conversation
Why needed (PROBLEM): Under 'chrony' configuration or/and further hwrtc change the RCU on the rtc_timer_do_work() reported and reproduced. Easy reproduced on armhf Nokia-AC3X. Not reproduced on SONiC TRIXIE. How fixed: drivers/rtc/interface.c: rtc_timer_do_work() When processing expired RTC events and rearming them, use "now" instead of "expiry" to prevent endless loops. Signed-off-by: Elad Nachman <enachman@marvell.com> Signed-off-by: Yan Markman <ymarkman@marvell.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
paulmenzel
left a comment
There was a problem hiding this comment.
Please also send this upstream for review.
|
|
||
| When processing expired RTC events and rearming them, use now | ||
| instead of expiry to prevent endless loops. | ||
|
|
There was a problem hiding this comment.
Please add a Fixes: tag, and also list the devices in the commit message.
|
|
||
| + 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", |
There was a problem hiding this comment.
Please re-write. Currently it’s more like a debug message. (Which is good to have.)
| /* 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*/, |
There was a problem hiding this comment.
We have git, so commenting this out is not useful.
sonic-net/sonic-linux-kernel#592 Signed-off-by: Yan Markman <ymarkman@marvell.com>
|
HI @paulmenzel |
|
I'm inclined to agree with the comments on the mailing list. What is special about your hardware that common code needs to be changed here? |
The HW is not special, the test added that changes the clock back and forth constantly is special, and apparently no other SONIC HW uses RTC as the main clock. |
Why needed (PROBLEM):
Under 'chrony' configuration or/and further hwrtc change the RCU on the rtc_timer_do_work() reported and reproduced.
How fixed:
drivers/rtc/interface.c: rtc_timer_do_work()
When processing expired RTC events and rearming them, use "now"
instead of "expiry" to prevent endless loops.