All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev
@ 2020-04-26  9:44 Sathishkumar Muruganandam
  2020-04-26  9:44 ` [PATCH v2 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW " Sathishkumar Muruganandam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sathishkumar Muruganandam @ 2020-04-26  9:44 UTC (permalink / raw)
  To: ath11k; +Cc: Sathishkumar Muruganandam

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
-- 
2.7.4

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW for deleted vdev
  2020-04-26  9:44 [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Sathishkumar Muruganandam
@ 2020-04-26  9:44 ` Sathishkumar Muruganandam
  2020-04-26  9:44 ` [PATCH v2 2/2] ath11k: add DBG_MAC prints to track vdev events Sathishkumar Muruganandam
  2020-04-27  9:44 ` [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Sathishkumar Muruganandam @ 2020-04-26  9:44 UTC (permalink / raw)
  To: ath11k; +Cc: Sathishkumar Muruganandam

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 <murugana@codeaurora.org>
---
 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

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] ath11k: add DBG_MAC prints to track vdev events
  2020-04-26  9:44 [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Sathishkumar Muruganandam
  2020-04-26  9:44 ` [PATCH v2 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW " Sathishkumar Muruganandam
@ 2020-04-26  9:44 ` Sathishkumar Muruganandam
  2020-04-27  9:44 ` [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Sathishkumar Muruganandam @ 2020-04-26  9:44 UTC (permalink / raw)
  To: ath11k; +Cc: Sathishkumar Muruganandam

Added DBG_MAC prints to track vdev create, delete, start and
stop events.

Signed-off-by: Sathishkumar Muruganandam <murugana@codeaurora.org>
---
 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

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev
  2020-04-26  9:44 [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Sathishkumar Muruganandam
  2020-04-26  9:44 ` [PATCH v2 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW " Sathishkumar Muruganandam
  2020-04-26  9:44 ` [PATCH v2 2/2] ath11k: add DBG_MAC prints to track vdev events Sathishkumar Muruganandam
@ 2020-04-27  9:44 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2020-04-27  9:44 UTC (permalink / raw)
  To: Sathishkumar Muruganandam; +Cc: ath11k

Sathishkumar Muruganandam <murugana@codeaurora.org> writes:

> 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

You need to Cc linux-wireless so that patchwork sees it. Please submit
v3.

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-27  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26  9:44 [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Sathishkumar Muruganandam
2020-04-26  9:44 ` [PATCH v2 1/2] ath11k: fix mgmt_tx_wmi cmd sent to FW " Sathishkumar Muruganandam
2020-04-26  9:44 ` [PATCH v2 2/2] ath11k: add DBG_MAC prints to track vdev events Sathishkumar Muruganandam
2020-04-27  9:44 ` [PATCH v2 0/2] ath11k: fix mgmt_tx_wmi cmd sent for deleted vdev Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.