diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2022-12-15 11:20:48 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2022-12-15 11:26:22 +0100 |
commit | c96d34f8281a307f9e4cf6fd00adc6eba377012c (patch) | |
tree | 1fb45ab52be15f6e1703d34d49dc87be017a80b8 | |
parent | c2261bb62e6af61c564e443a2e0b3b62939071f1 (diff) |
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
-rw-r--r-- | include/osmo-bts/bts.h | 2 | ||||
-rw-r--r-- | src/common/bts_shutdown_fsm.c | 11 | ||||
-rw-r--r-- | src/common/main.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index b1a594c4..bd664432 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -396,7 +396,7 @@ struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num); 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 0c6d80c1..f7a38d60 100644 --- a/src/common/bts_shutdown_fsm.c +++ b/src/common/bts_shutdown_fsm.c @@ -56,6 +56,7 @@ static unsigned int count_trx_operational(struct gsm_bts *bts) { 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 @@ static void st_none(struct osmo_fsm_inst *fi, uint32_t event, void *data) 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 @@ bool bts_shutdown_in_progress(const struct gsm_bts *bts) 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 @@ void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc) 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 954cc34c..ea6c61e4 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -233,7 +233,7 @@ static void signal_handler(int signum) 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 8c364c3c..dc90bf9e 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -195,7 +195,7 @@ void bts_model_abis_close(struct gsm_bts *bts) { /* 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) |