Skip to content

Commit 69a0fcf

Browse files
Sriram RKalle Valo
authored andcommitted
ath11k: Avoid reg rules update during firmware recovery
During firmware recovery, the default reg rules which are received via WMI_REG_CHAN_LIST_CC_EVENT can overwrite the currently configured user regd. See below snap for example, root@OpenWrt:/# iw reg get | grep country country FR: DFS-ETSI country FR: DFS-ETSI country FR: DFS-ETSI country FR: DFS-ETSI root@OpenWrt:/# echo assert > /sys/kernel/debug/ath11k/ipq8074\ hw2.0/simulate_f w_crash <snip> [ 5290.471696] ath11k c000000.wifi1: pdev 1 successfully recovered root@OpenWrt:/# iw reg get | grep country country FR: DFS-ETSI country US: DFS-FCC country US: DFS-FCC country US: DFS-FCC In the above, the user configured country 'FR' is overwritten when the rules of default country 'US' are received and updated during recovery. Hence avoid processing of these rules in general during firmware recovery as they have been already applied during driver registration or after last set user country is configured. This scenario applies for both AP and STA devices basically because cfg80211 is not aware of the recovery and only the driver recovers, but changing or resetting of the reg domain during recovery is not needed so as to continue with the configured regdomain currently in use. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01460-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sriram R <[email protected]> Signed-off-by: Jouni Malinen <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f394e4e commit 69a0fcf

File tree

1 file changed

+11
-0
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5848,6 +5848,17 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, struct sk_buff *sk
58485848

58495849
pdev_idx = reg_info->phy_id;
58505850

5851+
/* Avoid default reg rule updates sent during FW recovery if
5852+
* it is already available
5853+
*/
5854+
spin_lock(&ab->base_lock);
5855+
if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags) &&
5856+
ab->default_regd[pdev_idx]) {
5857+
spin_unlock(&ab->base_lock);
5858+
goto mem_free;
5859+
}
5860+
spin_unlock(&ab->base_lock);
5861+
58515862
if (pdev_idx >= ab->num_radios) {
58525863
/* Process the event for phy0 only if single_pdev_only
58535864
* is true. If pdev_idx is valid but not 0, discard the

0 commit comments

Comments
 (0)