daniel has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/30615 )
Change subject: shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C ......................................................................
shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C
For the other shutdown causes power ramping doesn't make sense. Instead shutdown quickly so we can reconnect faster
Change-Id: I71c46478b8f3b236dba3e959fc75e58c0409517f Related: SYS#6237 --- M include/osmo-bts/bts.h M src/common/bts_shutdown_fsm.c M src/common/main.c M src/osmo-bts-trx/l1_if.c 4 files changed, 9 insertions(+), 8 deletions(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index b1a594c..bd66443 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -396,7 +396,7 @@
int bts_init(struct gsm_bts *bts); void bts_shutdown(struct gsm_bts *bts, const char *reason); -void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc); +void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc, bool do_power_ramp);
int bts_link_estab(struct gsm_bts *bts);
diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c index 0c6d80c..f7a38d6 100644 --- a/src/common/bts_shutdown_fsm.c +++ b/src/common/bts_shutdown_fsm.c @@ -56,6 +56,7 @@ static void st_none(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_bts *bts = (struct gsm_bts *)fi->priv; + bool do_power_ramping = *(bool *)data; unsigned int count; switch(event) { case BTS_SHUTDOWN_EV_START: @@ -63,10 +64,10 @@ osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SHUTDOWN_START, NULL);
count = count_trx_operational(bts); - if (count) { + if (count && do_power_ramping) { bts_shutdown_fsm_state_chg(fi, BTS_SHUTDOWN_ST_WAIT_RAMP_DOWN_COMPL); } else { - /* we can skip ramp down since no TRX is running anyway. + /* we can skip ramp down if it was requested or no TRX is running anyway. * Let's jump into WAIT_TRX_CLOSED to make sure we * tell lower layer to close all TRX in case there's some * open() WIP */ @@ -250,7 +251,7 @@ return fi->state != BTS_SHUTDOWN_ST_NONE; }
-void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc) +void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc, bool do_power_ramp) { struct osmo_fsm_inst *fi = bts->shutdown_fi; if (bts_shutdown_in_progress(bts)) { @@ -262,12 +263,12 @@ bts->shutdown_fi_exit_proc = exit_proc; LOGPFSML(fi, LOGL_NOTICE, "Shutting down BTS, exit %u, reason: %s\n", exit_proc, reason); - osmo_fsm_inst_dispatch(fi, BTS_SHUTDOWN_EV_START, NULL); + osmo_fsm_inst_dispatch(fi, BTS_SHUTDOWN_EV_START, &do_power_ramp); }
void bts_shutdown(struct gsm_bts *bts, const char *reason) { - bts_shutdown_ext(bts, reason, true); + bts_shutdown_ext(bts, reason, true, false); }
void bts_model_trx_close_cb(struct gsm_bts_trx *trx, int rc) diff --git a/src/common/main.c b/src/common/main.c index 954cc34..ea6c61e 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -233,7 +233,7 @@ oml_tx_failure_event_rep(&g_bts->mo, NM_SEVER_CRITICAL, OSMO_EVT_CRIT_PROC_STOP, "BTS: SIGINT received -> shutdown"); - bts_shutdown(g_bts, "SIGINT"); + bts_shutdown_ext(g_bts, "SIGINT", true, false); } quit++; break; diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 8c364c3..dc90bf9 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -195,7 +195,7 @@ { /* Go into shutdown state deactivating transceivers until Abis link * becomes up again */ - bts_shutdown_ext(bts, "Abis close", false); + bts_shutdown_ext(bts, "Abis close", false, false); }
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan)