From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: linux-kernel@vger.kernel.org, alexander@wetzel-home.de,
johannes.berg@intel.com, Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org
Subject: Re: ieee80211_handle_wake_tx_queue and dynamic ps regression
Date: Tue, 10 Jan 2023 12:44:07 +0000 [thread overview]
Message-ID: <06f76774-1b2e-f563-7128-7d5b9547dfe9@linaro.org> (raw)
In-Reply-To: <19015168-c747-17b7-f0ae-9d2ee27d221c@linaro.org>
+ linux-wireless
On 10/01/2023 12:35, Bryan O'Donoghue wrote:
> commit a790cc3a4fad75048295571a350b95b87e022a5a
> (wake_tx_queue-broken-23-08-01)
> Author: Alexander Wetzel <alexander@wetzel-home.de>
> Date: Sun Oct 9 18:30:39 2022 +0200
>
> wifi: mac80211: add wake_tx_queue callback to drivers
>
> is causing a regression with
>
> - CONF_PS = 1
> - CONF_DYNAMIC_PS = 0
> - ieee80211_handle_wake_tx_queue
>
> In this case we get stuck in a loop similar to this
>
> // IEEE80211_CONF_CHANGE_PS
> [ 17.255480] wcn36xx: wcn36xx_change_ps/312 enable
> [ 18.088835] ieee80211_tx_h_dynamic_ps/263 setting
> IEEE80211_QUEUE_STOP_REASON_PS
> [ 18.088906] ieee80211_handle_wake_tx_queue/334 entry
> [ 18.091505] ieee80211_dynamic_ps_disable_work/2250 calling
> ieee80211_hw_config()
> [ 18.095370] ieee80211_handle_wake_tx_queue/338 wake_tx_push_queue
>
> // IEEE80211_CONF_CHANGE_PS
> [ 18.102625] wcn36xx: wcn36xx_change_ps/312 disable
> [ 18.107643] wake_tx_push_queue/303 entry
>
> // txq is stopped here reason == IEEE80211_QUEUE_STOP_REASON_PS
> [ 18.107654] wake_tx_push_queue/311 q_stopped bitmask 0x00000002
> IEEE80211_QUEUE_STOP_REASON_PS true
> [ 18.107661] wake_tx_push_queue/324 exit
> [ 18.107667] ieee80211_handle_wake_tx_queue/342 exit
> [ 18.115560] ieee80211_handle_wake_tx_queue/334 entry
> [ 18.139937] ieee80211_handle_wake_tx_queue/338 wake_tx_push_queue
> [ 18.145163] wake_tx_push_queue/303 entry
> [ 18.150016] ieee80211_dynamic_ps_disable_work/2252 completed
> ieee80211_hw_config()
>
> // now we unset IEEE80211_QUEUE_STOP_REASON_PS but too late
> [ 18.151145] wake_tx_push_queue/311 q_stopped bitmask 0x00000002
> IEEE80211_QUEUE_STOP_REASON_PS true
> [ 18.155263] ieee80211_dynamic_ps_disable_work/2254 clearing
> IEEE80211_QUEUE_STOP_REASON_PS
> [ 18.162531] wake_tx_push_queue/324 exit
> [ 18.162548] ieee80211_handle_wake_tx_queue/342 exit
> [ 18.183639] ieee80211_dynamic_ps_disable_work/2259 cleared
> IEEE80211_QUEUE_STOP_REASON_PS
>
> // IEEE80211_CONF_CHANGE_PS runs again
> [ 18.215487] wcn36xx: wcn36xx_change_ps/312 enable
>
> We get stuck in that loop. Packets getting transmitted is a rare event,
> most are dropped.
>
> I tried this as a fix
>
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -2245,15 +2245,15 @@ void ieee80211_dynamic_ps_disable_work(struct
> work_struct *work)
> container_of(work, struct ieee80211_local,
> dynamic_ps_disable_work);
>
> - if (local->hw.conf.flags & IEEE80211_CONF_PS) {
> - local->hw.conf.flags &= ~IEEE80211_CONF_PS;
> - ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
> - }
> -
> ieee80211_wake_queues_by_reason(&local->hw,
> IEEE80211_MAX_QUEUE_MAP,
> IEEE80211_QUEUE_STOP_REASON_PS,
> false);
> +
> + if (local->hw.conf.flags & IEEE80211_CONF_PS) {
> + local->hw.conf.flags &= ~IEEE80211_CONF_PS;
> + ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
> + }
> }
>
> but it only "slightly improves" the situation, the fundamental race
> condition is still there.
>
> Suggest reverting this change and trying again.
>
> ---
> bod
next parent reply other threads:[~2023-01-10 12:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <19015168-c747-17b7-f0ae-9d2ee27d221c@linaro.org>
2023-01-10 12:44 ` Bryan O'Donoghue [this message]
2023-01-10 14:47 ` ieee80211_handle_wake_tx_queue and dynamic ps regression Bryan O'Donoghue
2023-01-10 15:23 ` Alexander Wetzel
2023-01-10 15:43 ` Alexander Wetzel
2023-01-10 19:35 ` Bryan O'Donoghue
2023-01-13 12:17 ` Linux kernel regression tracking (#update)
2023-01-10 16:06 ` Bryan O'Donoghue
2023-01-10 13:08 ` Linux kernel regression tracking (Thorsten Leemhuis)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=06f76774-1b2e-f563-7128-7d5b9547dfe9@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=alexander@wetzel-home.de \
--cc=johannes.berg@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox