|
4 | 4 | * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
5 | 5 | * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
6 | 6 | * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
| 7 | + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
7 | 8 | */
|
8 | 9 |
|
9 | 10 | #include "mac.h"
|
@@ -1022,6 +1023,26 @@ static inline int ath10k_vdev_setup_sync(struct ath10k *ar)
|
1022 | 1023 | return ar->last_wmi_vdev_start_status;
|
1023 | 1024 | }
|
1024 | 1025 |
|
| 1026 | +static inline int ath10k_vdev_delete_sync(struct ath10k *ar) |
| 1027 | +{ |
| 1028 | + unsigned long time_left; |
| 1029 | + |
| 1030 | + lockdep_assert_held(&ar->conf_mutex); |
| 1031 | + |
| 1032 | + if (!test_bit(WMI_SERVICE_SYNC_DELETE_CMDS, ar->wmi.svc_map)) |
| 1033 | + return 0; |
| 1034 | + |
| 1035 | + if (test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) |
| 1036 | + return -ESHUTDOWN; |
| 1037 | + |
| 1038 | + time_left = wait_for_completion_timeout(&ar->vdev_delete_done, |
| 1039 | + ATH10K_VDEV_DELETE_TIMEOUT_HZ); |
| 1040 | + if (time_left == 0) |
| 1041 | + return -ETIMEDOUT; |
| 1042 | + |
| 1043 | + return 0; |
| 1044 | +} |
| 1045 | + |
1025 | 1046 | static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
|
1026 | 1047 | {
|
1027 | 1048 | struct cfg80211_chan_def *chandef = NULL;
|
@@ -5900,7 +5921,6 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
|
5900 | 5921 | struct ath10k *ar = hw->priv;
|
5901 | 5922 | struct ath10k_vif *arvif = (void *)vif->drv_priv;
|
5902 | 5923 | struct ath10k_peer *peer;
|
5903 |
| - unsigned long time_left; |
5904 | 5924 | int ret;
|
5905 | 5925 | int i;
|
5906 | 5926 |
|
@@ -5940,13 +5960,10 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
|
5940 | 5960 | ath10k_warn(ar, "failed to delete WMI vdev %i: %d\n",
|
5941 | 5961 | arvif->vdev_id, ret);
|
5942 | 5962 |
|
5943 |
| - if (test_bit(WMI_SERVICE_SYNC_DELETE_CMDS, ar->wmi.svc_map)) { |
5944 |
| - time_left = wait_for_completion_timeout(&ar->vdev_delete_done, |
5945 |
| - ATH10K_VDEV_DELETE_TIMEOUT_HZ); |
5946 |
| - if (time_left == 0) { |
5947 |
| - ath10k_warn(ar, "Timeout in receiving vdev delete response\n"); |
5948 |
| - goto out; |
5949 |
| - } |
| 5963 | + ret = ath10k_vdev_delete_sync(ar); |
| 5964 | + if (ret) { |
| 5965 | + ath10k_warn(ar, "Error in receiving vdev delete response: %d\n", ret); |
| 5966 | + goto out; |
5950 | 5967 | }
|
5951 | 5968 |
|
5952 | 5969 | /* Some firmware revisions don't notify host about self-peer removal
|
|
0 commit comments