All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
@ 2018-10-08  9:02 ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2018-10-08  9:02 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

In the noisy environment, if there are packets in the queue and can't
send out, the suspend timing will be more than 5 seconds due to the wait,
flush the queue to optimize the suspend timing, and let the upper layer to
retry the packets after resume.

Tested with QCA6174 PCI with firmware
WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
It's not a regression with new firmware releases.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
 drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97548f9..8df3cec 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6814,9 +6814,20 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			 u32 queues, bool drop)
 {
 	struct ath10k *ar = hw->priv;
-
-	if (drop)
+	struct ath10k_vif *arvif;
+	u32 bitmap;
+
+	if (drop) {
+		if (vif->type == NL80211_IFTYPE_STATION) {
+			bitmap = ~(1 << WMI_MGMT_TID);
+			list_for_each_entry(arvif, &ar->arvifs, list) {
+				if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
+					ath10k_wmi_peer_flush(ar, arvif->vdev_id,
+							      arvif->bssid, bitmap);
+			}
+		}
 		return;
+	}
 
 	mutex_lock(&ar->conf_mutex);
 	ath10k_mac_wait_tx_complete(ar);
-- 
1.9.1


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

* [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
@ 2018-10-08  9:02 ` Wen Gong
  0 siblings, 0 replies; 8+ messages in thread
From: Wen Gong @ 2018-10-08  9:02 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless

In the noisy environment, if there are packets in the queue and can't
send out, the suspend timing will be more than 5 seconds due to the wait,
flush the queue to optimize the suspend timing, and let the upper layer to
retry the packets after resume.

Tested with QCA6174 PCI with firmware
WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
It's not a regression with new firmware releases.

Signed-off-by: Wen Gong <wgong@codeaurora.org>
 drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 97548f9..8df3cec 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6814,9 +6814,20 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			 u32 queues, bool drop)
 {
 	struct ath10k *ar = hw->priv;
-
-	if (drop)
+	struct ath10k_vif *arvif;
+	u32 bitmap;
+
+	if (drop) {
+		if (vif->type == NL80211_IFTYPE_STATION) {
+			bitmap = ~(1 << WMI_MGMT_TID);
+			list_for_each_entry(arvif, &ar->arvifs, list) {
+				if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
+					ath10k_wmi_peer_flush(ar, arvif->vdev_id,
+							      arvif->bssid, bitmap);
+			}
+		}
 		return;
+	}
 
 	mutex_lock(&ar->conf_mutex);
 	ath10k_mac_wait_tx_complete(ar);
-- 
1.9.1


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

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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
  2018-10-08  9:02 ` Wen Gong
@ 2018-10-12 14:59   ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-12 14:59 UTC (permalink / raw)
  To: Wen Gong; +Cc: ath10k, linux-wireless

Wen Gong <wgong@codeaurora.org> writes:

> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
>
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>  drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)

The patch is slightly corrupted, there should be a "---" line before the
diffstat and that broke my patchwork script. I fixed it now in the
pending branch, but be careful if you manually edit patch files.

-- 
Kalle Valo

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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
@ 2018-10-12 14:59   ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-12 14:59 UTC (permalink / raw)
  To: Wen Gong; +Cc: linux-wireless, ath10k

Wen Gong <wgong@codeaurora.org> writes:

> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
>
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>  drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)

The patch is slightly corrupted, there should be a "---" line before the
diffstat and that broke my patchwork script. I fixed it now in the
pending branch, but be careful if you manually edit patch files.

-- 
Kalle Valo

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

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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
  2018-10-08  9:02 ` Wen Gong
  (?)
  (?)
@ 2018-10-13 17:25 ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-13 17:25 UTC (permalink / raw)
  To: Wen Gong; +Cc: ath10k, linux-wireless

Wen Gong <wgong@codeaurora.org> wrote:

> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
> 
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

9de4162f0999 ath10k: add peer flush in ath10k_flush for STATION

-- 
https://patchwork.kernel.org/patch/10630271/

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


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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
  2018-10-08  9:02 ` Wen Gong
                   ` (2 preceding siblings ...)
  (?)
@ 2018-10-13 17:25 ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2018-10-13 17:25 UTC (permalink / raw)
  To: Wen Gong; +Cc: linux-wireless, ath10k

Wen Gong <wgong@codeaurora.org> wrote:

> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
> 
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

9de4162f0999 ath10k: add peer flush in ath10k_flush for STATION

-- 
https://patchwork.kernel.org/patch/10630271/

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


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

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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
  2018-10-08  9:02 ` Wen Gong
@ 2018-11-08  0:35   ` Brian Norris
  -1 siblings, 0 replies; 8+ messages in thread
From: Brian Norris @ 2018-11-08  0:35 UTC (permalink / raw)
  To: wgong, Kalle Valo; +Cc: ath10k, linux-wireless

On Mon, Oct 8, 2018 at 2:03 AM Wen Gong <wgong@codeaurora.org> wrote:
>
> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
>
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>  drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 97548f9..8df3cec 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -6814,9 +6814,20 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>                          u32 queues, bool drop)
>  {
>         struct ath10k *ar = hw->priv;
> -
> -       if (drop)
> +       struct ath10k_vif *arvif;
> +       u32 bitmap;
> +
> +       if (drop) {
> +               if (vif->type == NL80211_IFTYPE_STATION) {

'vif' may be NULL. It is trivially easy for me to crash a system on
v4.20-rc1 by suspending the system while not connected.

I'll send a patch to fix this.

Brian

> +                       bitmap = ~(1 << WMI_MGMT_TID);
> +                       list_for_each_entry(arvif, &ar->arvifs, list) {
> +                               if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
> +                                       ath10k_wmi_peer_flush(ar, arvif->vdev_id,
> +                                                             arvif->bssid, bitmap);
> +                       }
> +               }
>                 return;
> +       }
>
>         mutex_lock(&ar->conf_mutex);
>         ath10k_mac_wait_tx_complete(ar);
> --
> 1.9.1
>

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

* Re: [PATCH] ath10k: Add peer flush in ath10k_flush for STATION
@ 2018-11-08  0:35   ` Brian Norris
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Norris @ 2018-11-08  0:35 UTC (permalink / raw)
  To: wgong, Kalle Valo; +Cc: linux-wireless, ath10k

On Mon, Oct 8, 2018 at 2:03 AM Wen Gong <wgong@codeaurora.org> wrote:
>
> In the noisy environment, if there are packets in the queue and can't
> send out, the suspend timing will be more than 5 seconds due to the wait,
> flush the queue to optimize the suspend timing, and let the upper layer to
> retry the packets after resume.
>
> Tested with QCA6174 PCI with firmware
> WLAN.RM.4.4.1-00109-QCARMSWPZ-1, but this will also affect QCA9377 PCI.
> It's not a regression with new firmware releases.
>
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
>  drivers/net/wireless/ath/ath10k/mac.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
> index 97548f9..8df3cec 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -6814,9 +6814,20 @@ static void ath10k_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>                          u32 queues, bool drop)
>  {
>         struct ath10k *ar = hw->priv;
> -
> -       if (drop)
> +       struct ath10k_vif *arvif;
> +       u32 bitmap;
> +
> +       if (drop) {
> +               if (vif->type == NL80211_IFTYPE_STATION) {

'vif' may be NULL. It is trivially easy for me to crash a system on
v4.20-rc1 by suspending the system while not connected.

I'll send a patch to fix this.

Brian

> +                       bitmap = ~(1 << WMI_MGMT_TID);
> +                       list_for_each_entry(arvif, &ar->arvifs, list) {
> +                               if (arvif->vdev_type == WMI_VDEV_TYPE_STA)
> +                                       ath10k_wmi_peer_flush(ar, arvif->vdev_id,
> +                                                             arvif->bssid, bitmap);
> +                       }
> +               }
>                 return;
> +       }
>
>         mutex_lock(&ar->conf_mutex);
>         ath10k_mac_wait_tx_complete(ar);
> --
> 1.9.1
>

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

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

end of thread, other threads:[~2018-11-08  0:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08  9:02 [PATCH] ath10k: Add peer flush in ath10k_flush for STATION Wen Gong
2018-10-08  9:02 ` Wen Gong
2018-10-12 14:59 ` Kalle Valo
2018-10-12 14:59   ` Kalle Valo
2018-10-13 17:25 ` Kalle Valo
2018-10-13 17:25 ` Kalle Valo
2018-11-08  0:35 ` Brian Norris
2018-11-08  0:35   ` Brian Norris

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.