<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/19988">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-bts-trx: fix trx_init(): do not send OPSTART ACK blindly<br><br>It was reported that both osmo-bsc and osmo-bts-trx may end up<br>running in a half-broken state, when everything looks good and<br>the UEs can see the network, but all channel requests get<br>rejected due to "trx not usable" error:<br><br>  lchan_select.c:173 (bts=0) lchan_select_by_type(SDCCH)<br>  lchan_select.c:48 looking for lchan CCCH+SDCCH4: (bts=0,trx=0) trx not usable<br>  lchan_select.c:48 looking for lchan SDCCH8: (bts=0,trx=0) trx not usable<br>  lchan_select.c:239 (bts=0) Failed to select SDCCH channel<br><br>  lchan_select.c:173 (bts=0) lchan_select_by_type(TCH_H)<br>  lchan_select.c:48 looking for lchan TCH/H: (bts=0,trx=0) trx not usable<br>  lchan_select.c:239 (bts=0) Failed to select TCH_H channel<br><br>  lchan_select.c:173 (bts=0) lchan_select_by_type(TCH_F)<br>  lchan_select.c:48 looking for lchan TCH/F: (bts=0,trx=0) trx not usable<br>  lchan_select.c:239 (bts=0) Failed to select TCH_F channel<br><br>As was then figured out, this happens because the Radio Carrier<br>MO (Managed Object) remains Disabled even after the BSC has<br>sent OPSTART and the BTS ACKed it:<br><br>  oml.c:986 OC=RADIO-CARRIER(02) INST=(00,00,ff): Rx OPSTART<br>  l1_if.c:614 Rx OPSTART for RADIO-CARRIER MO<br>  l1_if.c:201 TRX_PROV(phy0-0)[0x1238c0]{OPEN_POWERON}:<br>              Event TRX_PROV_EV_CFG_ENABLE not permitted<br>  oml.c:144 OC=RADIO-CARRIER(02) INST=(00,00,ff): Tx Opstart Ack<br><br>It remains a mistery why the TRX_PROV FSM is already in state<br>OPEN_POWERON, while it's expected to be in state OPEN_POWEROFF,<br>but we definitely should not ACKnowledge the OPSTART if this<br>happens.  Send a NACK instead with cause NM_NACK_CANT_PERFORM.<br><br>Change-Id: I8727460acbf850b84df67a9cbdc25b47dee1fadd<br>Related: SYS#5063<br>---<br>M src/osmo-bts-trx/l1_if.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></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 8cf0823..430d97e 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>@@ -197,8 +197,11 @@</span><br><span> {</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 style="color: hsl(120, 100%, 40%);">+        int rc;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-     osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CFG_ENABLE, (void*)(intptr_t)true);</span><br><span style="color: hsl(120, 100%, 40%);">+  rc = osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CFG_ENABLE, (void*)(intptr_t)true);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (rc != 0)</span><br><span style="color: hsl(120, 100%, 40%);">+          return oml_mo_opstart_nack(&trx->mo, NM_NACK_CANT_PERFORM);</span><br><span> </span><br><span>       if (trx == trx->bts->c0)</span><br><span>               lchan_init_lapdm(&trx->ts[0].lchan[CCCH_LCHAN]);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/19988">change 19988</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/+/19988"/><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: I8727460acbf850b84df67a9cbdc25b47dee1fadd </div>
<div style="display:none"> Gerrit-Change-Number: 19988 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>