aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-05-04 14:37:47 +0200
committerpespin <pespin@sysmocom.de>2023-05-05 14:33:52 +0000
commit8b306b6f93bcbabb46ed3b6faeff6bbaee45dbf7 (patch)
tree10fa321979031fd04c4d7ef55963a53f40f2ad7c
parent267c2606add44a6100915118913b01627e61d45e (diff)
bbtransc/rcarrier: Fix statechg done twice upon NM_EV_RX_OPSTART
When the NM_EV_RX_OPSTART event is received, it will call bts model specific function bts_model_opstart(), which is responisble for answering back with NM_EV_OPSTART_ACK or NM_EV_OPSTART_NACK. Since that answer could be done sequentially in same callback code path, we could end up twice at the end of the st_op_disabled_offline() function checking for statechg (due to reentring that function). As a result, one can see the following message appear during OML bring up: nm_bb_transc_fsm.c:185 NM_BBTRANSC_OP(bts0-trx0){ENABLED}: transition to state ENABLED not permitted! Fix the issue by avoiding ending up at the end of the function in code paths which should not be triggering any change. The case of bbtransc is a bit different than that of rcarrier for NM_EV_RX_SETATTR, since the former really doesn't receive any such message from the BSC yet, so if we checked for that one before continuing, it would never go on. Change-Id: I5184a33dd8da9244e8aacf3ab8bb8930f732a136
-rw-r--r--src/common/nm_bb_transc_fsm.c4
-rw-r--r--src/common/nm_radio_carrier_fsm.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/nm_bb_transc_fsm.c b/src/common/nm_bb_transc_fsm.c
index d42130a2..57ccdfa5 100644
--- a/src/common/nm_bb_transc_fsm.c
+++ b/src/common/nm_bb_transc_fsm.c
@@ -136,7 +136,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
&bb_transc->mo, bb_transc);
bb_transc->mo.setattr_success = rc == 0;
oml_fom_ack_nack_copy_msg(setattr_data->msg, rc);
- break;
+ return;
case NM_EV_RX_OPSTART:
#if 0
/* Disabled because osmo-bsc doesn't send SetAttr on BB_TRANSC object */
@@ -146,7 +146,7 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
}
#endif
bts_model_opstart(trx->bts, &bb_transc->mo, bb_transc);
- break;
+ return;
case NM_EV_OPSTART_ACK:
bb_transc->mo.opstart_success = true;
oml_mo_opstart_ack(&bb_transc->mo);
diff --git a/src/common/nm_radio_carrier_fsm.c b/src/common/nm_radio_carrier_fsm.c
index d7590bcf..851f71cb 100644
--- a/src/common/nm_radio_carrier_fsm.c
+++ b/src/common/nm_radio_carrier_fsm.c
@@ -120,14 +120,14 @@ static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, voi
&trx->mo, trx);
trx->mo.setattr_success = rc == 0;
oml_fom_ack_nack_copy_msg(setattr_data->msg, rc);
- break;
+ break; /* check statechg below */
case NM_EV_RX_OPSTART:
if (!trx->mo.setattr_success) {
oml_mo_opstart_nack(&trx->mo, NM_NACK_CANT_PERFORM);
return;
}
bts_model_opstart(trx->bts, &trx->mo, trx);
- break;
+ return;
case NM_EV_OPSTART_ACK:
trx->mo.opstart_success = true;
oml_mo_opstart_ack(&trx->mo);