aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-08-02 17:43:39 +0700
committerlaforge <laforge@osmocom.org>2020-08-02 20:20:19 +0000
commit9d5e955ea1b164217b9734a7806b412495899750 (patch)
tree636e89540a46804c6279b3f57cadc7263e1577f9 /src
parentfc3909a0b1b9ca9e2a1a9df49cb4be4cb5f51fe0 (diff)
osmo-bts-trx/scheduler: fix CLCK.ind handling during ramping down
On receipt of either SIGTERM or SIGINT the shutdown FSM initiates ramping down of the transmit power on Downlink. I noticed that for some reason osmo-bts-trx stops sending Downlink bursts during the process of ramping down. I also noticed the following imporatant message: DL1C NOTICE scheduler_trx.c:287 No more clock from transceiver despite the transceiver is still powered on and keeps sending the clock indications over the TRXC interface. As it turned out, the problem is that on receipt of either SIGTERM or SIGINT, we also raise the global 'quit' flag, so in the scheduler trx_sched_clock() stealthy stops handling the clock indications. Let's ensure that clock indications are handled regardless of the state of 'quit' flag, so the ramping down would work as expected. Change-Id: Ia71133d6f0b900e5e103595c83303a7cc5c06edf
Diffstat (limited to 'src')
-rw-r--r--src/common/main.c2
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c5
2 files changed, 1 insertions, 6 deletions
diff --git a/src/common/main.c b/src/common/main.c
index 6d8088ca..f4dc505d 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -56,7 +56,7 @@
#include <osmocom/ctrl/control_vty.h>
#include <osmo-bts/oml.h>
-int quit = 0;
+static int quit = 0;
static const char *config_file = "osmo-bts.cfg";
static int daemonize = 0;
static int rt_prio = -1;
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index fcd1eeef..85f0e92f 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -134,8 +134,6 @@ static inline void normalize_timespec(struct timespec *ts)
ts->tv_nsec = ts->tv_nsec % 1000000000;
}
-extern int quit;
-
/*! this is the timerfd-callback firing for every FN to be processed */
static int trx_fn_timer_cb(struct osmo_fd *ofd, unsigned int what)
{
@@ -274,9 +272,6 @@ int trx_sched_clock(struct gsm_bts *bts, uint32_t fn)
unsigned int fn_caught_up = 0;
const struct timespec interval = { .tv_sec = 0, .tv_nsec = GSM_TDMA_FN_DURATION_nS };
- if (quit)
- return 0;
-
/* reset lost counter */
tcs->fn_without_clock_ind = 0;