Change in osmo-bts[master]: bts-trx: Delay power ramp up until RCARRIER is ENABLED

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 https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Sep 30 11:30:59 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25645 )

Change subject: bts-trx: Delay power ramp up until RCARRIER is ENABLED
......................................................................

bts-trx: Delay power ramp up until RCARRIER is ENABLED

Prior to this patch, the power ramping started when the PHY is
available, but that doesn't necessarily mean the RCARRIER is enabled.

Due to this, it was spotted a situation where BTS bootstrap failed after
PHY turning up, when RSL connection establishment failed. Hence
bts_shutdown_fsm triggered a shutdown while an active power ramping up
was ongoing...

Change-Id: I17208b74ea2649b1bbb717aee0aa355e42b7e860
---
M include/osmo-bts/signal.h
M src/common/oml.c
M src/osmo-bts-trx/trx_provision_fsm.c
3 files changed, 37 insertions(+), 8 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/signal.h b/include/osmo-bts/signal.h
index c8168a2..8359f02 100644
--- a/include/osmo-bts/signal.h
+++ b/include/osmo-bts/signal.h
@@ -15,4 +15,10 @@
 	S_NEW_NSVC_ATTR,
 };
 
+struct nm_statechg_signal_data {
+	struct gsm_abis_mo *mo;
+	uint8_t old_state;
+	uint8_t new_state;
+};
+
 #endif
diff --git a/src/common/oml.c b/src/common/oml.c
index f841853..30caad5 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -355,12 +355,16 @@
 			mo->nm_state.availability = avail_state;
 		}
 		if (op_state != -1) {
+			struct nm_statechg_signal_data nsd;
 			LOGP(DOML, LOGL_INFO, "%s OPER STATE %s -> %s\n",
 				gsm_abis_mo_name(mo),
 				abis_nm_opstate_name(mo->nm_state.operational),
 				abis_nm_opstate_name(op_state));
+			nsd.mo = mo;
+			nsd.old_state = mo->nm_state.operational;
+			nsd.new_state = op_state;
 			mo->nm_state.operational = op_state;
-			osmo_signal_dispatch(SS_GLOBAL, S_NEW_OP_STATE, NULL);
+			osmo_signal_dispatch(SS_GLOBAL, S_NEW_OP_STATE, &nsd);
 		}
 		if (adm_state != -1) {
 			LOGP(DOML, LOGL_INFO, "%s ADMIN STATE %s -> %s\n",
diff --git a/src/osmo-bts-trx/trx_provision_fsm.c b/src/osmo-bts-trx/trx_provision_fsm.c
index 39fb608..52736ad 100644
--- a/src/osmo-bts-trx/trx_provision_fsm.c
+++ b/src/osmo-bts-trx/trx_provision_fsm.c
@@ -34,6 +34,7 @@
 #include <osmo-bts/bts.h>
 #include <osmo-bts/rsl.h>
 #include <osmo-bts/nm_common_fsm.h>
+#include <osmo-bts/signal.h>
 
 #include "l1_if.h"
 #include "trx_provision_fsm.h"
@@ -314,6 +315,30 @@
 	}
 }
 
+static int trx_prov_fsm_signal_cb(unsigned int subsys, unsigned int signal,
+				  void *hdlr_data, void *signal_data)
+{
+	struct nm_statechg_signal_data *nsd;
+	struct gsm_bts_trx *trx;
+
+	if (subsys != SS_GLOBAL)
+		return -EINVAL;
+
+	if (signal != S_NEW_OP_STATE)
+		return 0;
+
+	nsd = (struct nm_statechg_signal_data *)signal_data;
+
+	if (nsd->mo->obj_class != NM_OC_RADIO_CARRIER)
+		return 0;
+
+	if (nsd->old_state != NM_OPSTATE_ENABLED && nsd->new_state == NM_OPSTATE_ENABLED) {
+		trx = gsm_objclass2obj(nsd->mo->bts, nsd->mo->obj_class, &nsd->mo->obj_inst);
+		l1if_trx_start_power_ramp(trx, NULL);
+	}
+	return 0;
+}
+
 //////////////////////////
 // FSM STATE ACTIONS
 //////////////////////////
@@ -511,13 +536,6 @@
 		if (rc == 0 && plink->state != PHY_LINK_CONNECTED) {
 			trx_sched_clock_started(pinst->trx->bts);
 			phy_link_state_set(plink, PHY_LINK_CONNECTED);
-
-			/* Begin to ramp up the power on all TRX associated with this phy */
-			llist_for_each_entry(pinst, &plink->instances, list) {
-				if (pinst->trx->mo.nm_state.administrative == NM_STATE_UNLOCKED)
-					l1if_trx_start_power_ramp(pinst->trx, NULL);
-			}
-
 			trx_prov_fsm_state_chg(fi, TRX_PROV_ST_OPEN_POWERON);
 		} else if (rc != 0 && plink->state != PHY_LINK_SHUTDOWN) {
 			trx_sched_clock_stopped(pinst->trx->bts);
@@ -709,4 +727,5 @@
 static __attribute__((constructor)) void trx_prov_fsm_init(void)
 {
 	OSMO_ASSERT(osmo_fsm_register(&trx_prov_fsm) == 0);
+	OSMO_ASSERT(osmo_signal_register_handler(SS_GLOBAL, trx_prov_fsm_signal_cb, NULL) == 0);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25645
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I17208b74ea2649b1bbb717aee0aa355e42b7e860
Gerrit-Change-Number: 25645
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210930/f062aa83/attachment.htm>


More information about the gerrit-log mailing list