linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: un-schedule TXQs on powersave start
@ 2019-03-19 11:00 Felix Fietkau
  2019-03-19 22:15 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2019-03-19 11:00 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, Toke Høiland-Jørgensen

Once a station enters powersave, its queues should not be returned by
ieee80211_next_txq() anymore. They will be re-scheduled again after the
station has woken up again

Fixes: 1866760096bf4 ("mac80211: Add TXQ scheduling API")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/rx.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 295535b75184..60aac91e35d0 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1568,7 +1568,15 @@ static void sta_ps_start(struct sta_info *sta)
 		return;
 
 	for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
-		if (txq_has_queue(sta->sta.txq[tid]))
+		struct ieee80211_txq *txq = sta->sta.txq[tid];
+		struct txq_info *txqi = to_txq_info(txq);
+
+		spin_lock(&local->active_txq_lock[txq->ac]);
+		if (!list_empty(&txqi->schedule_order))
+			list_del_init(&txqi->schedule_order);
+		spin_unlock(&local->active_txq_lock[txq->ac]);
+
+		if (txq_has_queue(txq))
 			set_bit(tid, &sta->txq_buffered_tids);
 		else
 			clear_bit(tid, &sta->txq_buffered_tids);
-- 
2.17.0


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

* Re: [PATCH v2] mac80211: un-schedule TXQs on powersave start
  2019-03-19 11:00 [PATCH v2] mac80211: un-schedule TXQs on powersave start Felix Fietkau
@ 2019-03-19 22:15 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-03-19 22:15 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless; +Cc: johannes

Felix Fietkau <nbd@nbd.name> writes:

> Once a station enters powersave, its queues should not be returned by
> ieee80211_next_txq() anymore. They will be re-scheduled again after the
> station has woken up again
>
> Fixes: 1866760096bf4 ("mac80211: Add TXQ scheduling API")
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>

> ---
>  net/mac80211/rx.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 295535b75184..60aac91e35d0 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -1568,7 +1568,15 @@ static void sta_ps_start(struct sta_info *sta)
>  		return;
>  
>  	for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
> -		if (txq_has_queue(sta->sta.txq[tid]))
> +		struct ieee80211_txq *txq = sta->sta.txq[tid];
> +		struct txq_info *txqi = to_txq_info(txq);
> +
> +		spin_lock(&local->active_txq_lock[txq->ac]);
> +		if (!list_empty(&txqi->schedule_order))
> +			list_del_init(&txqi->schedule_order);
> +		spin_unlock(&local->active_txq_lock[txq->ac]);
> +
> +		if (txq_has_queue(txq))
>  			set_bit(tid, &sta->txq_buffered_tids);
>  		else
>  			clear_bit(tid, &sta->txq_buffered_tids);
> -- 
> 2.17.0

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

end of thread, other threads:[~2019-03-19 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 11:00 [PATCH v2] mac80211: un-schedule TXQs on powersave start Felix Fietkau
2019-03-19 22:15 ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).