We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7bc36d commit 080acffCopy full SHA for 080acff
drivers/net/wireless/ath/ath12k/mac.c
@@ -4865,15 +4865,10 @@ int ath12k_mac_get_fw_stats(struct ath12k *ar,
4865
* still there could be more events following. Below is to wait
4866
* until firmware completes sending all the events.
4867
*/
4868
- for (;;) {
4869
- if (time_after(jiffies, timeout))
4870
- break;
4871
- spin_lock_bh(&ar->data_lock);
4872
- if (ar->fw_stats.fw_stats_done) {
4873
- spin_unlock_bh(&ar->data_lock);
4874
4875
- }
4876
+ time_left = wait_for_completion_timeout(&ar->fw_stats_done, 3 * HZ);
+ if (!time_left) {
+ ath12k_warn(ab, "time out while waiting for fw stats done\n");
+ return -ETIMEDOUT;
4877
}
4878
4879
return 0;
0 commit comments