mirror of https://github.com/PentHertz/srsLTE.git
Fix deadlock caused by update_measurements calling in_sync (#1760)
This commit is contained in:
parent
eb370642ab
commit
399b986d0b
|
@ -620,6 +620,8 @@ void phy_common::update_measurements(uint32_t
|
||||||
std::vector<rrc_interface_phy_lte::phy_meas_t>& serving_cells,
|
std::vector<rrc_interface_phy_lte::phy_meas_t>& serving_cells,
|
||||||
cf_t* rssi_power_buffer)
|
cf_t* rssi_power_buffer)
|
||||||
{
|
{
|
||||||
|
bool insync = true;
|
||||||
|
{
|
||||||
std::unique_lock<std::mutex> lock(meas_mutex);
|
std::unique_lock<std::mutex> lock(meas_mutex);
|
||||||
|
|
||||||
float snr_ema_coeff = args->snr_ema_coeff;
|
float snr_ema_coeff = args->snr_ema_coeff;
|
||||||
|
@ -635,8 +637,9 @@ void phy_common::update_measurements(uint32_t
|
||||||
|
|
||||||
if (!rssi_read_cnt) {
|
if (!rssi_read_cnt) {
|
||||||
// Average RSSI over all symbols in antenna port 0 (make sure SF length is non-zero)
|
// Average RSSI over all symbols in antenna port 0 (make sure SF length is non-zero)
|
||||||
float rssi_dbm = SRSLTE_SF_LEN_PRB(cell.nof_prb) > 0 ? (srslte_convert_power_to_dB(srslte_vec_avg_power_cf(
|
float rssi_dbm = SRSLTE_SF_LEN_PRB(cell.nof_prb) > 0
|
||||||
rssi_power_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb))) +
|
? (srslte_convert_power_to_dB(
|
||||||
|
srslte_vec_avg_power_cf(rssi_power_buffer, SRSLTE_SF_LEN_PRB(cell.nof_prb))) +
|
||||||
30)
|
30)
|
||||||
: 0;
|
: 0;
|
||||||
if (std::isnormal(rssi_dbm)) {
|
if (std::isnormal(rssi_dbm)) {
|
||||||
|
@ -736,16 +739,22 @@ void phy_common::update_measurements(uint32_t
|
||||||
if (avg_rsrp_dbm[0] > args->in_sync_rsrp_dbm_th && avg_snr_db_cqi[0] > args->in_sync_snr_db_th) {
|
if (avg_rsrp_dbm[0] > args->in_sync_rsrp_dbm_th && avg_snr_db_cqi[0] > args->in_sync_snr_db_th) {
|
||||||
log_h->debug(
|
log_h->debug(
|
||||||
"SNR=%.1f dB, RSRP=%.1f dBm sync=in-sync from channel estimator\n", avg_snr_db_cqi[0], avg_rsrp_dbm[0]);
|
"SNR=%.1f dB, RSRP=%.1f dBm sync=in-sync from channel estimator\n", avg_snr_db_cqi[0], avg_rsrp_dbm[0]);
|
||||||
if (insync_itf) {
|
|
||||||
insync_itf->in_sync();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
log_h->warning(
|
log_h->warning(
|
||||||
"SNR=%.1f dB RSRP=%.1f dBm, sync=out-of-sync from channel estimator\n", avg_snr_db_cqi[0], avg_rsrp_dbm[0]);
|
"SNR=%.1f dB RSRP=%.1f dBm, sync=out-of-sync from channel estimator\n", avg_snr_db_cqi[0], avg_rsrp_dbm[0]);
|
||||||
|
insync = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Report in-sync status to the stack outside the mutex lock
|
||||||
if (insync_itf) {
|
if (insync_itf) {
|
||||||
|
if (insync) {
|
||||||
|
insync_itf->in_sync();
|
||||||
|
} else {
|
||||||
insync_itf->out_of_sync();
|
insync_itf->out_of_sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call feedback loop for chest
|
// Call feedback loop for chest
|
||||||
if (cc_idx == 0) {
|
if (cc_idx == 0) {
|
||||||
if (insync_itf && ((1U << (sf_cfg_dl.tti % 10U)) & args->cfo_ref_mask)) {
|
if (insync_itf && ((1U << (sf_cfg_dl.tti % 10U)) & args->cfo_ref_mask)) {
|
||||||
|
|
Loading…
Reference in New Issue