wifi: ath11k: change complete() to complete_all() for scan.completed
authorWen Gong <quic_wgong@quicinc.com>
Mon, 19 Sep 2022 13:06:03 +0000 (16:06 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 22 Sep 2022 07:15:51 +0000 (10:15 +0300)
Currently commit 1f682dc9fb37 ("ath11k: reduce the wait time of 11d scan
and hw scan while add interface") introduced a wait_for_completion_timeout
operation for ar->scan.completed, another one is existed in ath11k_scan_stop(),
then ath11k has two places to wait for the ar->scan.completed and they
run in different thread, thus it is possible to happend that the two
thread both enter wait status. To handle this scenario, ath11k should
change the complete() to complete_all() for the ar->scan.completed. This
also work well when it is only one thread wait for ar->scan.completed.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220919024413.25083-1-quic_wgong@quicinc.com
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/mac.c

index d71043ae4fbf33ffcb1c6db096f66782860a4653..87808ffd4a6cf21b52f253ac8c20260094ff3cad 100644 (file)
@@ -1609,7 +1609,7 @@ static void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab)
                ar->state_11d = ATH11K_11D_IDLE;
                complete(&ar->completed_11d_scan);
                complete(&ar->scan.started);
-               complete(&ar->scan.completed);
+               complete_all(&ar->scan.completed);
                complete(&ar->scan.on_channel);
                complete(&ar->peer_assoc_done);
                complete(&ar->peer_delete_done);
index 6eb0b80fc96fa9adbca0d7fd830b9f18491a4904..f9d417410c4c33ac8d45d09e1732fe5213e73ce6 100644 (file)
@@ -3456,7 +3456,7 @@ void __ath11k_mac_scan_finish(struct ath11k *ar)
                ar->scan_channel = NULL;
                ar->scan.roc_freq = 0;
                cancel_delayed_work(&ar->scan.timeout);
-               complete(&ar->scan.completed);
+               complete_all(&ar->scan.completed);
                break;
        }
 }