<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/19537">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx: fix resource leak in bts_model_trx_deact_rf()<br><br>I noticed that "RF-locking" a transceiver with active connections<br>(e.g. voice calls) leads to a resource leak: the BSC would continue<br>to consider the associated logical channels occupied, so the MSC<br>would also consider the CS connections active (if any).<br><br>The radio link timeout counter is expected prevent such cases, but<br>it's driven by either valid SACCH blocks, or bad frame indications<br>triggered by NOPE indications from transceiver.  The problem is<br>that we basically reset the scheduler in bts_model_trx_deact_rf(),<br>and stop sending / receiving bursts, so this counter would be lost.<br><br>Let's ensure that RSL Radio Link Failure indications are sent to<br>the BSC for all active logical channels that "survied" after the<br>ramping down.  This is exactly what the other BTS models do.<br><br>Change-Id: Id20d12f76b1aac5c81a79eb293e537ed41a1c28a<br>Related: OS#4694<br>---<br>M src/osmo-bts-trx/l1_if.c<br>1 file changed, 25 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/19537/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c</span><br><span>index a2b3415..c4c743f 100644</span><br><span>--- a/src/osmo-bts-trx/l1_if.c</span><br><span>+++ b/src/osmo-bts-trx/l1_if.c</span><br><span>@@ -213,6 +213,31 @@</span><br><span>     struct phy_instance *pinst = trx_phy_instance(trx);</span><br><span>  struct trx_l1h *l1h = pinst->u.osmotrx.hdl;</span><br><span>       enum gsm_phys_chan_config pchan = trx->ts[0].pchan;</span><br><span style="color: hsl(120, 100%, 40%);">+        unsigned int tn, ln;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Send RSL Radio Link Failure for all active DCCHs */</span><br><span style="color: hsl(120, 100%, 40%);">+        for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {</span><br><span style="color: hsl(120, 100%, 40%);">+          const struct gsm_bts_trx_ts *ts = &trx->ts[tn];</span><br><span style="color: hsl(120, 100%, 40%);">+                if (ts->pchan == GSM_PCHAN_NONE)</span><br><span style="color: hsl(120, 100%, 40%);">+                   continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           for (ln = 0; ln < ARRAY_SIZE(ts->lchan); ln++) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        const struct gsm_lchan *lchan = &ts->lchan[ln];</span><br><span style="color: hsl(120, 100%, 40%);">+                        if (lchan->state != LCHAN_S_ACTIVE)</span><br><span style="color: hsl(120, 100%, 40%);">+                                continue;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                   switch (lchan->type) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     case GSM_LCHAN_SDCCH:</span><br><span style="color: hsl(120, 100%, 40%);">+                 case GSM_LCHAN_TCH_F:</span><br><span style="color: hsl(120, 100%, 40%);">+                 case GSM_LCHAN_TCH_H:</span><br><span style="color: hsl(120, 100%, 40%);">+                         rsl_tx_conn_fail(lchan, RSL_ERR_RADIO_LINK_FAIL);</span><br><span style="color: hsl(120, 100%, 40%);">+                             break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        default:</span><br><span style="color: hsl(120, 100%, 40%);">+                              /* Make GCC happy */</span><br><span style="color: hsl(120, 100%, 40%);">+                          continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> </span><br><span>        /* close all logical channels and reset timeslots */</span><br><span>         trx_sched_reset(&l1h->l1s);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/19537">change 19537</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/19537"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id20d12f76b1aac5c81a79eb293e537ed41a1c28a </div>
<div style="display:none"> Gerrit-Change-Number: 19537 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>