From 18bf9d583e8f807cc9ee5bd3dfc7e435cdcb8792 Mon Sep 17 00:00:00 2001 From: Raghavendra Dinavahi Date: Thu, 12 Mar 2026 07:10:10 +0100 Subject: [PATCH] UE: update pdcch config only after mib read --- openair2/LAYER2/NR_MAC_UE/config_ue.c | 4 ++-- openair2/LAYER2/NR_MAC_UE/mac_defs.h | 3 +++ openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 475badfdba..8dcc2e398c 100644 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -2106,8 +2106,8 @@ static void handle_reconfiguration_with_sync(NR_UE_MAC_INST_t *mac, configure_common_BWP_ul(mac, bwp_id, scc->uplinkConfigCommon->initialUplinkBWP); // Update PDCCH config as MAC configuration has changed - if (IS_SA_MODE(get_softmodem_params())) - update_pdcch_config(mac); + // Used only in SA mode. + mac->update_pdcch_config = IS_SA_MODE(get_softmodem_params()); } mac->state = UE_NOT_SYNC_RECONF; diff --git a/openair2/LAYER2/NR_MAC_UE/mac_defs.h b/openair2/LAYER2/NR_MAC_UE/mac_defs.h index 10a89adc89..df970600d5 100644 --- a/openair2/LAYER2/NR_MAC_UE/mac_defs.h +++ b/openair2/LAYER2/NR_MAC_UE/mac_defs.h @@ -639,6 +639,9 @@ typedef struct NR_UE_MAC_INST_s { pthread_mutex_t if_mutex; ue_mac_stats_t stats; notifiedFIFO_t input_nf; + // set when mac configuration changes during reconf with sync + // reset when pdcch config is changed after pbch read after reconf + bool update_pdcch_config; } NR_UE_MAC_INST_t; static inline int GET_NTN_UE_K_OFFSET(const fapi_nr_ntn_config_t *ntn_ta, int scs) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c index 43aab362f3..e70366a274 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c @@ -461,8 +461,11 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl NR_BWP_PDCCH_t *pdcch_config = &mac->config_BWP_PDCCH[dl_bwp_id]; int scs = current_DL_BWP ? current_DL_BWP->scs : mac->numerology; const int slots_per_frame = get_slots_per_frame_from_scs(scs); - if (mac->get_sib1) { + if (mac->get_sib1 || mac->update_pdcch_config) { update_pdcch_config(mac); + mac->update_pdcch_config = false; + } + if (mac->get_sib1) { bool is_occasion = is_ss_monitor_occasion(frame, slot, slots_per_frame, mac->search_space_zero); if (is_occasion) { LOG_D(NR_MAC_DCI, "Monitoring DCI for SIB1 in frame %d slot %d\n", frame, slot);