This patch set adds fix for the case of mgmt_tx_wmi cmd sent
to FW for deleted vdev.
And also patch having DBG_MAC prints to track vdev events which
will help in debugging.
Sathishkumar Muruganandam (2):
ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev
ath11k: add DBG_MAC prints to track vdev events
drivers/net/wireless/ath/ath11k/mac.c | 37 ++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
v2:
added ath11k prefix to cover letter
v3:
Cc'ed linux-wireless
--
2.7.4
Added DBG_MAC prints to track vdev create, delete, start and
stop events.
Signed-off-by: Sathishkumar Muruganandam <[email protected]>
---
drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 2b3a63ac216c..bfe2d20de351 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -4229,6 +4229,8 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
}
ar->num_created_vdevs++;
+ ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM created, vdev_id %d\n",
+ vif->addr, arvif->vdev_id);
ar->allocated_vdev_map |= 1LL << arvif->vdev_id;
ab->free_vdev_map &= ~(1LL << arvif->vdev_id);
@@ -4399,6 +4401,8 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,
arvif->vdev_id, ret);
ar->num_created_vdevs--;
+ ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM deleted, vdev_id %d\n",
+ vif->addr, arvif->vdev_id);
ar->allocated_vdev_map &= ~(1LL << arvif->vdev_id);
ab->free_vdev_map |= 1LL << (arvif->vdev_id);
@@ -4664,6 +4668,8 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
}
ar->num_started_vdevs++;
+ ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM started, vdev_id %d\n",
+ arvif->vif->addr, arvif->vdev_id);
/* Enable CAC Flag in the driver by checking the channel DFS cac time,
* i.e dfs_cac_ms value which will be valid only for radar channels
@@ -4722,6 +4728,8 @@ static int ath11k_mac_vdev_stop(struct ath11k_vif *arvif)
WARN_ON(ar->num_started_vdevs == 0);
ar->num_started_vdevs--;
+ ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM stopped, vdev_id %d\n",
+ arvif->vif->addr, arvif->vdev_id);
if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) {
clear_bit(ATH11K_CAC_RUNNING, &ar->dev_flags);
--
2.7.4
In Multi-AP VAP scenario with frequent interface up-down, there is a
chance that ath11k_mgmt_over_wmi_tx_work() will dequeue a skb
corresponding to currently deleted/stopped vdev.
FW will assert on receiving mgmt_tx_wmi cmd for already deleted vdev.
Hence adding validation checks for arvif present on the corresponding
ar before sending mgmt_tx_wmi cmd.
Signed-off-by: Sathishkumar Muruganandam <[email protected]>
---
drivers/net/wireless/ath/ath11k/mac.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 065b7d6d4ab2..2b3a63ac216c 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3793,15 +3793,30 @@ static void ath11k_mgmt_over_wmi_tx_work(struct work_struct *work)
while ((skb = skb_dequeue(&ar->wmi_mgmt_tx_queue)) != NULL) {
info = IEEE80211_SKB_CB(skb);
- arvif = ath11k_vif_to_arvif(info->control.vif);
-
- ret = ath11k_mac_mgmt_tx_wmi(ar, arvif, skb);
- if (ret) {
- ath11k_warn(ar->ab, "failed to transmit management frame %d\n",
- ret);
+ if (!info->control.vif) {
+ ath11k_warn(ar->ab, "no vif found for mgmt frame, flags 0x%x\n",
+ info->control.flags);
ieee80211_free_txskb(ar->hw, skb);
+ continue;
+ }
+
+ arvif = ath11k_vif_to_arvif(info->control.vif);
+ if (ar->allocated_vdev_map & (1LL << arvif->vdev_id) &&
+ arvif->is_started) {
+ ret = ath11k_mac_mgmt_tx_wmi(ar, arvif, skb);
+ if (ret) {
+ ath11k_warn(ar->ab, "failed to tx mgmt frame, vdev_id %d :%d\n",
+ arvif->vdev_id, ret);
+ ieee80211_free_txskb(ar->hw, skb);
+ } else {
+ atomic_inc(&ar->num_pending_mgmt_tx);
+ }
} else {
- atomic_inc(&ar->num_pending_mgmt_tx);
+ ath11k_warn(ar->ab,
+ "dropping mgmt frame for vdev %d, flags 0x%x is_started %d\n",
+ arvif->vdev_id, info->control.flags,
+ arvif->is_started);
+ ieee80211_free_txskb(ar->hw, skb);
}
}
}
--
2.7.4
Hi Sathishkumar,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on v5.7-rc3 next-20200424]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sathishkumar-Muruganandam/ath11k-fix-mgmt_tx_wmi-cmd-sent-for-deleted-vdev/20200428-074921
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <[email protected]>
All errors (new ones prefixed by >>):
In file included from drivers/net/wireless/ath/ath11k/mac.c:10:
drivers/net/wireless/ath/ath11k/mac.c: In function 'ath11k_mac_vdev_stop':
>> drivers/net/wireless/ath/ath11k/mac.c:4731:13: error: 'ab' undeclared (first use in this function); did you mean 'ar'?
4731 | ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM stopped, vdev_id %d\n",
| ^~
drivers/net/wireless/ath/ath11k/debug.h:301:16: note: in definition of macro 'ath11k_dbg'
301 | __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
| ^~
drivers/net/wireless/ath/ath11k/mac.c:4731:13: note: each undeclared identifier is reported only once for each function it appears in
4731 | ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM stopped, vdev_id %d\n",
| ^~
drivers/net/wireless/ath/ath11k/debug.h:301:16: note: in definition of macro 'ath11k_dbg'
301 | __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
| ^~
vim +4731 drivers/net/wireless/ath/ath11k/mac.c
4697
4698 static int ath11k_mac_vdev_stop(struct ath11k_vif *arvif)
4699 {
4700 struct ath11k *ar = arvif->ar;
4701 int ret;
4702
4703 lockdep_assert_held(&ar->conf_mutex);
4704
4705 reinit_completion(&ar->vdev_setup_done);
4706
4707 spin_lock_bh(&ar->data_lock);
4708
4709 ar->vdev_stop_status.stop_in_progress = true;
4710 ar->vdev_stop_status.vdev_id = arvif->vdev_id;
4711
4712 spin_unlock_bh(&ar->data_lock);
4713
4714 ret = ath11k_wmi_vdev_stop(ar, arvif->vdev_id);
4715 if (ret) {
4716 ath11k_warn(ar->ab, "failed to stop WMI vdev %i: %d\n",
4717 arvif->vdev_id, ret);
4718 goto err;
4719 }
4720
4721 ret = ath11k_mac_vdev_setup_sync(ar);
4722 if (ret) {
4723 ath11k_warn(ar->ab, "failed to synchronize setup for vdev %i: %d\n",
4724 arvif->vdev_id, ret);
4725 goto err;
4726 }
4727
4728 WARN_ON(ar->num_started_vdevs == 0);
4729
4730 ar->num_started_vdevs--;
> 4731 ath11k_dbg(ab, ATH11K_DBG_MAC, "vdev %pM stopped, vdev_id %d\n",
4732 arvif->vif->addr, arvif->vdev_id);
4733
4734 if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) {
4735 clear_bit(ATH11K_CAC_RUNNING, &ar->dev_flags);
4736 ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "CAC Stopped for vdev %d\n",
4737 arvif->vdev_id);
4738 }
4739
4740 return 0;
4741 err:
4742 spin_lock_bh(&ar->data_lock);
4743 ar->vdev_stop_status.stop_in_progress = false;
4744 spin_unlock_bh(&ar->data_lock);
4745
4746 return ret;
4747 }
4748
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]