fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/42855?usp=email )
Change subject: osmo-bts-trx: fix spurious clock skew shutdown after self-compensation
......................................................................
osmo-bts-trx: fix spurious clock skew shutdown after self-compensation
When the BTS runs ahead of the transceiver (elapsed_fn < 0),
trx_sched_clock() reschedules the timerfd to deliberately delay the
next FN. osmo_timerfd_schedule() resets the timerfd and discards any
accumulated expirations, but last_fn_timer.tv was left pointing at
the previous callback. The next trx_fn_timer_cb() then measures
elapsed_us all the way back to that previous callback - spanning the
deliberate delay (or any OS stall that preceded us) - and falsely
trips the "PC clock skew too high" check, shutting the BTS down
for no good reason.
Advance last_fn_timer.tv to the projected firing time of the
rescheduled timer so that the next callback measures roughly
one FN interval, as expected.
Change-Id: Icdb7db8abe70258ae008d9514b6608bd74bb2881
AI-Assisted: yes (Claude)
Related: OS#6794
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index a4585ae..261d37b 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -616,13 +616,20 @@
/* too many frames have been processed already */
if (elapsed_fn < 0) {
struct timespec first = interval;
- /* set clock to the time or last FN should have been
- * transmitted. */
+ /* set clock to the time our next FN has to be transmitted */
first.tv_nsec += (0 - elapsed_fn) * GSM_TDMA_FN_DURATION_nS;
normalize_timespec(&first);
LOGP(DL1C, LOGL_NOTICE, "We were %d FN faster than TRX, compensating\n", -elapsed_fn);
- /* set time to the time our next FN has to be transmitted */
osmo_timerfd_schedule(&tcs->fn_timer_ofd, &first, &interval);
+ /* Advance last_fn_timer.tv to the projected firing time of the rescheduled
+ * timer (shifted back one interval). osmo_timerfd_schedule() resets the
+ * timerfd, discarding any accumulated expirations, so without this update
+ * trx_fn_timer_cb() would measure elapsed_us all the way back to the previous
+ * callback — spanning the deliberate delay or any OS stall that preceded us —
+ * and falsely trip the clock skew threshold. */
+ tcs->last_fn_timer.tv = tv_now;
+ tcs->last_fn_timer.tv.tv_nsec += (0 - elapsed_fn) * GSM_TDMA_FN_DURATION_nS;
+ normalize_timespec(&tcs->last_fn_timer.tv);
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/42855?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icdb7db8abe70258ae008d9514b6608bd74bb2881
Gerrit-Change-Number: 42855
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Attention is currently required from: jolly, laforge.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/onomondo-eim/+/42870?usp=email )
Change subject: asn1/SGP32Definitions: apply workarounds
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS1:
> well, then include that checkpatch exception in the (previous) patch 😊
Thanks for the hint.
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42870?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Id90b005fc3c8c8f737b0c740d4c067f90842a1fe
Gerrit-Change-Number: 42870
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 30 Jun 2026 09:54:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: fixeria, jolly, laforge.
Hello Jenkins Builder, jolly, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/onomondo-eim/+/42869?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified-1 by Jenkins Builder
Change subject: asn1/SGP32Definitions: upgrade ASN.1 spec to V.1.2
......................................................................
asn1/SGP32Definitions: upgrade ASN.1 spec to V.1.2
This replaces the existing SGP.32 V.1.0.1 ASN.1 spec with the
unmodified, official SGP.32 V.1.2 spec.
Unfortunately V.1.2 is not backward compatible to V.1.0.1. This means
that the eIM application will still compile, but the result will be
non-functional. The incompatibility problems will be addressed in
the follow-up patches of this patchset.
Change-Id: Id4d217296f43846aa39f5dc7076465e2dab72a7c
Related: SYS#8100
---
A .checkpatch.conf
M asn1/SGP32Definitions.asn1
2 files changed, 729 insertions(+), 636 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/69/42869/3
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42869?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: Id4d217296f43846aa39f5dc7076465e2dab72a7c
Gerrit-Change-Number: 42869
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
dexter has abandoned this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069?usp=email )
Change subject: WIP: fixup for PCU_Tests: use PCUIF v.11 exclusively
......................................................................
Abandoned
this patch is no longer needed
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34069?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: abandon
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5e72cbf4bcc2fc4fa305861bd7cf08e00ef7df1d
Gerrit-Change-Number: 34069
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder