pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/34894?usp=email )

Change subject: Revert "trx_if: Allow calling trx_if_flush/close from within 
TRXC callback"
......................................................................

Revert "trx_if: Allow calling trx_if_flush/close from within TRXC callback"

This reverts commit 4444262a6ab1e1e231ea81c4ec990f1a1f571a1f.
This commit introduced several side effects:
- tcm is left out of the l1h->trx_ctrl_list and hence won't be ever
  retransmitted.
- Since tcm is removed before rsp callback, the llist may become empty
  and if somehwere in the rsp callback a new message is enqueud it will
  be sent immediatelly, and will be retransmitted again when
trx_ctrl_read_cb() calls trx_ctrl_send() at the end.

Change-Id: Ideb2d08ac8a2902bceeabfb055c59c9a13dbe3c0
Related: OS#6020
---
M src/osmo-bts-trx/trx_if.c
1 file changed, 25 insertions(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index fef8c22..3f9fc04 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -721,13 +721,6 @@

        rsp.cb = tcm->cb;

-       /* Remove command from list, save it to last_acked and remove previous
-        * last_acked. Do it before calling callback to avoid user freeing tcm
-        * pointer if flushing/closing the iface. */
-       llist_del(&tcm->list);
-       talloc_free(l1h->last_acked);
-       l1h->last_acked = tcm;
-
        /* check for response code */
        rc = trx_ctrl_rx_rsp(l1h, &rsp, tcm);
        if (rc == -EINVAL)
@@ -735,11 +728,15 @@

        /* re-schedule last cmd in rc seconds time */
        if (rc > 0) {
-               if (!llist_empty(&l1h->trx_ctrl_list))
-                       osmo_timer_schedule(&l1h->trx_ctrl_timer, rc, 0);
+               osmo_timer_schedule(&l1h->trx_ctrl_timer, rc, 0);
                return 0;
        }

+       /* remove command from list, save it to last_acked and removed previous 
last_acked */
+       llist_del(&tcm->list);
+       talloc_free(l1h->last_acked);
+       l1h->last_acked = tcm;
+
        trx_ctrl_send(l1h);

        return 0;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34894?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ideb2d08ac8a2902bceeabfb055c59c9a13dbe3c0
Gerrit-Change-Number: 34894
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to