summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-01-04 05:17:51 +0300
committerVadim Yanitskiy <axilirator@gmail.com>2018-01-05 14:35:37 +0700
commit0c201abbffa6404b134374c59e6f9ed73e6757c0 (patch)
treead6cdf8b6f2d64a16e08c5506a288430c2abb90a
parent5c70e48077352d35b86aec733dda59d05aab1e01 (diff)
trxcon/scheduler: deactivate lchans when resetting / deleting TS
Previously, when resetting or deleting a timeslot, we did not deactivate the logical channels, relaying on talloc hierarchical nature. This approach may cause some problems, e.g. on embedded systems with emulated talloc API. Change-Id: I8c34c793df87bd8c79b7bf1f05b949faf10520e8
-rw-r--r--src/host/trxcon/sched_trx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 2142119..9567844 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -194,6 +194,12 @@ void sched_trx_del_ts(struct trx_instance *trx, int tn)
LOGP(DSCH, LOGL_NOTICE, "Delete TDMA timeslot #%u\n", tn);
+ /* Deactivate all logical channels */
+ sched_trx_deactivate_all_lchans(ts);
+
+ /* Free channel states */
+ talloc_free(ts->lchans);
+
/* Flush queue primitives for TX */
sched_prim_flush_queue(&ts->tx_prims);
@@ -284,6 +290,9 @@ int sched_trx_reset_ts(struct trx_instance *trx, int tn)
/* Flush queue primitives for TX */
sched_prim_flush_queue(&ts->tx_prims);
+ /* Deactivate all logical channels */
+ sched_trx_deactivate_all_lchans(ts);
+
/* Free channel states */
talloc_free(ts->lchans);