<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/19405">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bts-trx: Fix handling ADM state change while previous one WIP<br><br>Fix power ramping if administrative state changes while previous<br>opposite change was already ACKED but powe ramping was still ongoing.<br><br>With previous code, osmo-bts-trx would have sent a NACK and BSc would<br>drop the BTs link as a result.<br><br>Change-Id: I6c5240710ef6d223651dfb4a8db939b5d2f974ca<br>---<br>M src/osmo-bts-trx/l1_if.c<br>1 file changed, 24 insertions(+), 5 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/05/19405/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 cd7ecc0..6b93825 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>@@ -662,11 +662,29 @@</span><br><span>                  break;</span><br><span> </span><br><span>           if (mo->procedure_pending) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 LOGPTRX(trx, DL1C, LOGL_ERROR, "Discarding adm change command: "</span><br><span style="color: hsl(0, 100%, 40%);">-                              "pending procedure on RC %d\n",</span><br><span style="color: hsl(0, 100%, 40%);">-                               ((struct gsm_bts_trx *)obj)->nr);</span><br><span style="color: hsl(0, 100%, 40%);">-                    rc = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-                        break;</span><br><span style="color: hsl(120, 100%, 40%);">+                        LOGPTRX(trx, DL1C, LOGL_INFO,</span><br><span style="color: hsl(120, 100%, 40%);">+                         "ADM change received while previus one still WIP\n");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (mo->nm_state.administrative == NM_STATE_LOCKED &&</span><br><span style="color: hsl(120, 100%, 40%);">+                          adm_state == NM_STATE_UNLOCKED) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         /* Previous change was UNLOCKED->LOCKED, so we</span><br><span style="color: hsl(120, 100%, 40%);">+                              * were ramping down and we didn't deactivate</span><br><span style="color: hsl(120, 100%, 40%);">+                              * yet, so now simply skip old ramp down compl</span><br><span style="color: hsl(120, 100%, 40%);">+                                 * cb, skip TS activation and go for ramp up</span><br><span style="color: hsl(120, 100%, 40%);">+                           * directly. */</span><br><span style="color: hsl(120, 100%, 40%);">+                               goto ramp_up;</span><br><span style="color: hsl(120, 100%, 40%);">+                 } else if (mo->nm_state.administrative == NM_STATE_UNLOCKED &&</span><br><span style="color: hsl(120, 100%, 40%);">+                         adm_state == NM_STATE_LOCKED) {</span><br><span style="color: hsl(120, 100%, 40%);">+                           /* Previous change was LOCKED->UNLOCKED, which</span><br><span style="color: hsl(120, 100%, 40%);">+                              * means TS were also enabled during start of</span><br><span style="color: hsl(120, 100%, 40%);">+                          * ramping up. So we simply need to skip</span><br><span style="color: hsl(120, 100%, 40%);">+                               * ramping up and start ramping down instead,</span><br><span style="color: hsl(120, 100%, 40%);">+                          * disabling TS at the end as usual. Fall</span><br><span style="color: hsl(120, 100%, 40%);">+                              * through usual procedure below.</span><br><span style="color: hsl(120, 100%, 40%);">+                              */</span><br><span style="color: hsl(120, 100%, 40%);">+                   } else if (mo->nm_state.administrative == adm_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             OSMO_ASSERT(0);</span><br><span style="color: hsl(120, 100%, 40%);">+                       }</span><br><span>            }</span><br><span>            switch (adm_state) {</span><br><span>                 case NM_STATE_LOCKED:</span><br><span>@@ -687,6 +705,7 @@</span><br><span>                          }</span><br><span>                            trx_set_ts(ts);</span><br><span>                      }</span><br><span style="color: hsl(120, 100%, 40%);">+ramp_up:</span><br><span>                  rc = l1if_trx_start_power_ramp(trx, bts_model_chg_adm_state_ramp_compl_cb);</span><br><span>                  if (rc == 0) {</span><br><span>                               mo->nm_state.administrative = adm_state;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/19405">change 19405</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/+/19405"/><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: I6c5240710ef6d223651dfb4a8db939b5d2f974ca </div>
<div style="display:none"> Gerrit-Change-Number: 19405 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>