summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-07-31 21:51:14 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-07-31 22:16:40 +0700
commitb95a897655ae0817b92e4d80190b6d852b152215 (patch)
tree0a5271a59cf2fcaa5b0fd38e81210017c9d1d61a /src
parent92e9820966bf6cea79325ad1c7e59c9dc95cdca3 (diff)
firmware/layer1: fix properly apply secondary multi-frame task
When a dedicated channel is activated, in chan_nr2mf_task_mask() we calculate a bitmask of the corresponding multi-frame tasks to be enabled. Three logical kinds of the multi-frame tasks exist: - primary (master) - the main burst processing task, e.g. MF_TASK_{TCH_F_ODD,SDCCH4_0,GPRS_PDTCH}; - secondary - additional burst processing task (optional), e.g. MF_TASK_GPRS_PTCCH; - measurement - neighbour measurement task (optional), e.g. MF_TASK_NEIGH_{PM51,PM26E,PM26O}. By default, the primary task is set to MF_TASK_BCCH_NORM (0x00). Due to a mistake, the secondary task has also been set to BCCH, so when we switch to a dedicated mode, we also enable the BCCH. This leads to a race condition between the multi-frame tasks, when both primary and secondary ones read bursts from the DSP at the same time, so the firmware hangs because of that: nb_cmd(0) and rxnb.msg != NULL BURST ID 2!=0 BURST ID 3!=1 This regression was introduced together with experimental PDCH support [1]. Let's use value -1 to indicate that the secondary task is not set, and apply it properly. Change-Id: I4d667b2106fd8453eac9e24019bdfb14358d75e3 Fixes: [1] I44531bbe8743c188cc5d4a6ca2a63000e41d6189 Related: OS#3155
Diffstat (limited to 'src')
-rw-r--r--src/target/firmware/layer1/l23_api.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index e9ce0324..4621bfca 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -77,8 +77,8 @@ static uint32_t chan_nr2mf_task_mask(uint8_t chan_nr, uint8_t neigh_mode)
uint8_t cbits = chan_nr >> 3;
uint8_t tn = chan_nr & 0x7;
uint8_t lch_idx;
- enum mframe_task master_task = 0;
- enum mframe_task second_task = 0;
+ enum mframe_task master_task = MF_TASK_BCCH_NORM;
+ enum mframe_task second_task = -1; /* optional */
enum mf_type multiframe = 0;
uint32_t task_mask = 0x00;
@@ -123,7 +123,9 @@ static uint32_t chan_nr2mf_task_mask(uint8_t chan_nr, uint8_t neigh_mode)
}
/* Primary and secondary tasks */
- task_mask |= (1 << master_task) | (1 << second_task);
+ task_mask |= (1 << master_task);
+ if (second_task >= 0) /* optional */
+ task_mask |= (1 << second_task);
switch (neigh_mode) {
case NEIGH_MODE_PM: