<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11996">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bsc: lchan_fsm: Fix invalid duplicated transition<br><br>When we enter WAIT_RLL_RTP_RELEASED<br>(lchan_fsm_wait_rll_rtp_released_onenter), we call lchan_do_release()<br>which in turn dispatches LCHAN_RTP_EV_RELEASE to lchan_rtp_fsm.c, which<br>will dispatch back an LCHAN_EV_RTP_RELEASED event, which will be handled<br>by lchan_fsm_wait_rll_rtp_released(), which will change state to<br>WAIT_BEFORE_RF_RELEASE. When going back the stack (return), we are still<br>in lchan_fsm_wait_rll_rtp_released_onenter() which again triggers a<br>change state to WAIT_BEFORE_RF_RELEASE because it checks same conditions<br>than first one.<br><br>20181128203727051 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:1388 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{ESTABLISHED}: lchan detaches from conn SUBSCR_CONN(conn3)[0x612000002da0]<br>20181128203727051 DMSC <0007> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:1391 SUBSCR_CONN(conn3)[0x612000002da0]{CLEARING}: lchan lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0] detaches from conn<br>20181128203727051 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:1359 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{ESTABLISHED}: state_chg to WAIT_RLL_RTP_RELEASED<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:959 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: (type=TCH_F) SAPI[0] = 1<br>20181128203727052 DRR <0002> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/gsm_04_08_rr.c:254 Sending Channel Release: Chan: Number: 0 Type: 2<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:945 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Received Event LCHAN_RTP_EV_RELEASE<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Terminating (cause = OSMO_FSM_TERM_REGULAR)<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Removing from parent lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_rtp_fsm.c:572 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Freeing instance<br>20181128203727052 DCHAN <0010> fsm.c:381 lchan_rtp(0-0-6-TCH_F_PDCH-0)[0x6120000027a0]{ESTABLISHED}: Deallocated<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_rtp_fsm.c:572 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: Received Event LCHAN_EV_RTP_RELEASED<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:856 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: (type=TCH_F) Still active SAPIs: 0<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:1011 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_RLL_RTP_RELEASED}: state_chg to WAIT_BEFORE_RF_RELEASE<br>20181128203727052 DRSL <0003> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/abis_rsl.c:633 (bts=0,trx=0,ts=6,ss=0) DEACTivate SACCH CMD<br>20181128203727052 DCHAN <0010> /home/pespin/dev/git/osmo-bsc/src/osmo-bsc/lchan_fsm.c:986 lchan(0-0-6-TCH_F_PDCH-0)[0x6120000039a0]{WAIT_BEFORE_RF_RELEASE}: transition to state WAIT_BEFORE_RF_RELEASE not permitted!<br><br>Change-Id: I5d95bbd8244cc8e9c1cfb6fe0f76148332386a3d<br>---<br>M src/osmo-bsc/lchan_fsm.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/11996/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c</span><br><span>index e557cf3..c060435 100644</span><br><span>--- a/src/osmo-bsc/lchan_fsm.c</span><br><span>+++ b/src/osmo-bsc/lchan_fsm.c</span><br><span>@@ -958,6 +958,9 @@</span><br><span>          if (lchan->sapis[sapi])</span><br><span>                   LOG_LCHAN(lchan, LOGL_DEBUG, "SAPI[%d] = %d\n", sapi, lchan->sapis[sapi]);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   /* It could be that we receive LCHAN_EV_RTP_RELEASED synchronously and</span><br><span style="color: hsl(120, 100%, 40%);">+           as a result we may end up in state WAIT_BEFORE_RF_RELEASE after</span><br><span style="color: hsl(120, 100%, 40%);">+       lchan_do_release has returned */</span><br><span>  lchan_do_release(lchan);</span><br><span> </span><br><span>         sapis = 0;</span><br><span>@@ -982,7 +985,7 @@</span><br><span>             sapis = 0;</span><br><span>   }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   if (!sapis && !lchan->fi_rtp)</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!sapis && !lchan->fi_rtp && fi->state == LCHAN_ST_WAIT_RLL_RTP_RELEASED)</span><br><span>           lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE);</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11996">change 11996</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/11996"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5d95bbd8244cc8e9c1cfb6fe0f76148332386a3d </div>
<div style="display:none"> Gerrit-Change-Number: 11996 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>