Change in osmo-bts[master]: bts-trx: Avoid race condition configuring TS-specific TSC values

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at

pespin gerrit-no-reply at
Tue Sep 21 13:03:11 UTC 2021

pespin has uploaded this change for review. ( )

Change subject: bts-trx: Avoid race condition configuring TS-specific TSC values

bts-trx: Avoid race condition configuring TS-specific TSC values

In OML, if Set Attributes comes first for Channel object and then for
BTS object, BSIC will still not be set. Hence, when applying Channel
(TS) specific TSC, the code would compare against an unset value,
enabling use of TRXC extensions (which osmo-trx doesn't support)
without need for it, since actually the TSC of the TS matches the BSIC
of the BTS once both are set.

In order to fix it, don't check for the BSIC when receiving the OML
messages, but rather later when we apply the settings to the the lower
layers once trx_provision_fsm allows for it.

Fixes: 3c1151f9456bdf0d7348c27c0cabbb41e84fcbbc
Change-Id: I49fc7e35acb44ecc4f37ae71acd4c684248548e7
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-trx/trx_if.c
2 files changed, 4 insertions(+), 2 deletions(-)

  git pull ssh:// refs/changes/27/25527/1

diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 0b96017..97c140e 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -292,7 +292,7 @@
 	struct trx_prov_ev_cfg_ts_data data = { .tn = tn, .slottype = slottype };
-	if (ts->tsc_set != 0 || ts->tsc != BTS_TSC(ts->trx->bts)) {
+	if (ts->tsc_set != 0) {
 		/* On TRXC we use 3GPP compliant numbering, so +1 */
 		data.tsc_set = ts->tsc_set + 1;
 		data.tsc_val = ts->tsc;
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 22e912d..29a3663 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -332,8 +332,10 @@
 		       trx_if_cmd_setslot_cb *cb)
 	const struct trx_config *cfg = &l1h->config;
+	const struct phy_instance *pinst = l1h->phy_inst;
-	if (cfg->setslot[tn].tsc_valid) { /* PHY is instructed to use a custom TSC */
+	if (cfg->setslot[tn].tsc_valid && cfg->setslot[tn].tsc_val != BTS_TSC(pinst->trx->bts)) {
+		/* PHY is instructed to use a custom TSC */
 		return trx_ctrl_cmd_cb(l1h, 1, cb, "SETSLOT", "%u %u C%u/S%u",
 				       tn, cfg->setslot[tn].slottype,

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I49fc7e35acb44ecc4f37ae71acd4c684248548e7
Gerrit-Change-Number: 25527
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list