Skip to content

Commit c5b92a2

Browse files
Baochen QiangJeff Johnson
authored andcommitted
wifi: ath11k: move locking outside of ath11k_mac_get_fw_stats()
Currently ath11k_mac_get_fw_stats() is acquiring/releasing ar->conf_mutex by itself. In order to reuse this function in a context where that lock is already taken, move lock handling to its callers, then the function itself only has to assert it. There is only one caller now, i.e., ath11k_mac_op_sta_statistics(), so add lock handling there. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Signed-off-by: Baochen Qiang <[email protected]> Reviewed-by: Vasanthakumar Thiagarajan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]>
1 parent 81f6416 commit c5b92a2

File tree

1 file changed

+5
-8
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+5
-8
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9052,12 +9052,10 @@ static int ath11k_mac_get_fw_stats(struct ath11k *ar, u32 pdev_id,
90529052
struct stats_request_params req_param;
90539053
int ret;
90549054

9055-
mutex_lock(&ar->conf_mutex);
9055+
lockdep_assert_held(&ar->conf_mutex);
90569056

9057-
if (ar->state != ATH11K_STATE_ON) {
9058-
ret = -ENETDOWN;
9059-
goto err_unlock;
9060-
}
9057+
if (ar->state != ATH11K_STATE_ON)
9058+
return -ENETDOWN;
90619059

90629060
req_param.pdev_id = pdev_id;
90639061
req_param.vdev_id = vdev_id;
@@ -9071,9 +9069,6 @@ static int ath11k_mac_get_fw_stats(struct ath11k *ar, u32 pdev_id,
90719069
"debug get fw stat pdev id %d vdev id %d stats id 0x%x\n",
90729070
pdev_id, vdev_id, stats_id);
90739071

9074-
err_unlock:
9075-
mutex_unlock(&ar->conf_mutex);
9076-
90779072
return ret;
90789073
}
90799074

@@ -9111,6 +9106,7 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
91119106

91129107
ath11k_mac_put_chain_rssi(sinfo, arsta, "ppdu", false);
91139108

9109+
mutex_lock(&ar->conf_mutex);
91149110
if (!(sinfo->filled & BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL)) &&
91159111
arsta->arvif->vdev_type == WMI_VDEV_TYPE_STA &&
91169112
ar->ab->hw_params.supports_rssi_stats &&
@@ -9126,6 +9122,7 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
91269122
!(ath11k_mac_get_fw_stats(ar, ar->pdev->pdev_id, 0,
91279123
WMI_REQUEST_VDEV_STAT)))
91289124
signal = arsta->rssi_beacon;
9125+
mutex_unlock(&ar->conf_mutex);
91299126

91309127
ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
91319128
"sta statistics db2dbm %u rssi comb %d rssi beacon %d\n",

0 commit comments

Comments
 (0)