From 76bfc781475a3492c40cabb392b8c46174589f10 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Thu, 24 Sep 2020 22:25:24 +0200 Subject: [PATCH] Fix issues with Sounding-RS (#1761) * Fix deadlock caused by update_measurements calling in_sync * Fix overlapping SRS condition * Do not use shortened PUSCH in transmissions and retx from RAR * Revert "Fix deadlock caused by update_measurements calling in_sync" This reverts commit f58c8c8c766f8f95baa3a3bf8287d8e25b2057ba. --- lib/include/srslte/interfaces/ue_interfaces.h | 1 + lib/include/srslte/phy/phch/pusch_cfg.h | 1 + lib/src/phy/ch_estimation/refsignal_ul.c | 10 +++++++++- srsue/src/stack/mac/ul_harq.cc | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index e825285c7..30fa507c8 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -399,6 +399,7 @@ public: tb_action_t tb; uint32_t current_tx_nb; bool expect_ack; + bool is_rar; } tb_action_ul_t; /* Query the MAC for the current RNTI to look for diff --git a/lib/include/srslte/phy/phch/pusch_cfg.h b/lib/include/srslte/phy/phch/pusch_cfg.h index 53059035d..3a787ce87 100644 --- a/lib/include/srslte/phy/phch/pusch_cfg.h +++ b/lib/include/srslte/phy/phch/pusch_cfg.h @@ -52,6 +52,7 @@ typedef struct SRSLTE_API { srslte_ra_tb_t tb; srslte_ra_tb_t last_tb; uint32_t n_dmrs; + bool is_rar; } srslte_pusch_grant_t; diff --git a/lib/src/phy/ch_estimation/refsignal_ul.c b/lib/src/phy/ch_estimation/refsignal_ul.c index 9a4580d21..c9ad08f48 100644 --- a/lib/src/phy/ch_estimation/refsignal_ul.c +++ b/lib/src/phy/ch_estimation/refsignal_ul.c @@ -759,6 +759,14 @@ void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q, { bool shortened = false; + // A UE shall not transmit SRS whenever SRS and a PUSCH transmission corresponding to a Random Access Response + // Grant or a retransmission of the same transport block as part of the contention based random access procedure + // coincide in the same subframe. + if (pusch_cfg->grant.is_rar) { + sf->shortened = false; + return; + } + if (srs_cfg->configured) { // If UE-specific SRS is configured, PUSCH is shortened every time UE transmits SRS even if overlaping in the same // RB or not @@ -786,7 +794,7 @@ void srslte_refsignal_srs_pusch_shortened(srslte_refsignal_ul_t* q, uint32_t nrb_srs = srslte_refsignal_srs_rb_L_cs(srs_cfg->bw_cfg, q->cell.nof_prb); for (uint32_t ns = 0; ns < 2 && !shortened; ns++) { if ((pusch_cfg->grant.n_prb_tilde[ns] >= k0_srs && pusch_cfg->grant.n_prb_tilde[ns] < k0_srs + nrb_srs) || - (pusch_cfg->grant.n_prb_tilde[ns] + pusch_cfg->grant.L_prb >= k0_srs && + (pusch_cfg->grant.n_prb_tilde[ns] + pusch_cfg->grant.L_prb > k0_srs && pusch_cfg->grant.n_prb_tilde[ns] + pusch_cfg->grant.L_prb < k0_srs + nrb_srs) || (pusch_cfg->grant.n_prb_tilde[ns] <= k0_srs && pusch_cfg->grant.n_prb_tilde[ns] + pusch_cfg->grant.L_prb >= k0_srs + nrb_srs)) { diff --git a/srsue/src/stack/mac/ul_harq.cc b/srsue/src/stack/mac/ul_harq.cc index 8239c53fa..6bc10f92b 100644 --- a/srsue/src/stack/mac/ul_harq.cc +++ b/srsue/src/stack/mac/ul_harq.cc @@ -368,6 +368,8 @@ void ul_harq_entity::ul_harq_process::generate_new_tx(mac_interface_phy_lte::mac current_tx_nb = 0; current_irv = 0; + action->is_rar = grant.is_rar || (grant.rnti == harq_entity->rntis->temp_rnti); + Info("UL %d: New TX%s, RV=%d, TBS=%d\n", pid, grant.rnti == harq_entity->rntis->temp_rnti ? " for Msg3" : "",