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.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25823 ) Change subject: bts_shutdown_fsm: Make sure pending power ramping are aborted before closing TRX ...................................................................... bts_shutdown_fsm: Make sure pending power ramping are aborted before closing TRX It can happen when using several TRX that all of them go alreadyunder shutdown target tx power level, but that due to configuration the BTS still may want to keep pushing the tx power level even lower. Hence, we end up in a situation where the FSM is trying to close all the TRX while the power ramp procedure is ongoing for some of them. As a result, race conditions can happen where for instance the power ramping procedure for one TRX ends and calls the cb to send SETPOWER after the TRX PHY has been closed (and hence TRXC link is unavaialble). If that happens, the trx_if lower layers store the SETPOWER and attempt a later retransmit, which may take up to 2 seconds after TRX becomes active if BTS reconnects immediatelly. Hence, we end up in some test cases where BTS reconnects and configures some TRX while others are kep unconfigured for a while due to the mentioned delay, hence the test attempting to use the TS while it hasn't been yet configured. The solution is to avoid this kind of unexpected events with ongoing powe ramp once we have decided tx power is lower enough to shutdown the TRX completely. Hence we abort the pending power ramp procedure. Change-Id: Ibca581131eb142d7c38c917a0d6990efec03123c --- M include/osmo-bts/tx_power.h M src/common/bts_shutdown_fsm.c M src/common/tx_power.c 3 files changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/25823/1 diff --git a/include/osmo-bts/tx_power.h b/include/osmo-bts/tx_power.h index 8f68d8a..a7f846e 100644 --- a/include/osmo-bts/tx_power.h +++ b/include/osmo-bts/tx_power.h @@ -78,6 +78,7 @@ int get_p_trxout_actual_mdBm_lchan(const struct gsm_lchan *lchan); int power_ramp_start(struct gsm_bts_trx *trx, int p_total_tgt_mdBm, int bypass, ramp_compl_cb_t ramp_compl_cb); +void power_ramp_abort(struct gsm_bts_trx *trx); void power_trx_change_compl(struct gsm_bts_trx *trx, int p_trxout_cur_mdBm); diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c index a663f5b..0c6d80c 100644 --- a/src/common/bts_shutdown_fsm.c +++ b/src/common/bts_shutdown_fsm.c @@ -112,8 +112,15 @@ LOGPFSML(fi, LOGL_INFO, "%s Ramping down complete, %u TRX remaining\n", gsm_trx_name(src_trx), remaining); - if (remaining == 0) + if (remaining == 0) { + /* Make sure we end up any remaining ongoing power ramp + * down under target shutdown tx power level, then + * finally transit to next state: + */ + llist_for_each_entry(trx, &bts->trx_list, list) + power_ramp_abort(trx); bts_shutdown_fsm_state_chg(fi, BTS_SHUTDOWN_ST_WAIT_TRX_CLOSED); + } break; } } diff --git a/src/common/tx_power.c b/src/common/tx_power.c index 348aba5..0307422 100644 --- a/src/common/tx_power.c +++ b/src/common/tx_power.c @@ -259,7 +259,7 @@ } /* Cancel any pending request */ - osmo_timer_del(&tpp->ramp.step_timer); + power_ramp_abort(trx); /* set the new target */ tpp->p_total_tgt_mdBm = p_total_tgt_mdBm; @@ -297,6 +297,12 @@ return 0; } +/* Cancel any pending request */ +void power_ramp_abort(struct gsm_bts_trx *trx) +{ + osmo_timer_del(&trx->power_params.ramp.step_timer); +} + /* determine the initial transceiver output power at start-up time */ int power_ramp_initial_power_mdBm(const struct gsm_bts_trx *trx) { -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25823 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: Ibca581131eb142d7c38c917a0d6990efec03123c Gerrit-Change-Number: 25823 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211019/95237983/attachment.htm>