Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7761015rwl; Tue, 10 Jan 2023 05:12:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXtKnla9XkXDkCMyQpo2lQ5hEeziBaEMhR2vz5dOnhjU8+P9Zok5jGS6OKRUphCoW4XOalTO X-Received: by 2002:a05:6402:c8d:b0:499:bec8:3a78 with SMTP id cm13-20020a0564020c8d00b00499bec83a78mr3901782edb.41.1673356339277; Tue, 10 Jan 2023 05:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673356339; cv=none; d=google.com; s=arc-20160816; b=RnlTw5BQFizYCWXllfI6s+Dl5IBcnD5/ueyRYQWU2MrOZLL0VDFMD04GC2Wcqa/4zm BiQM6CEOrpnv17chZuQrzjpD2xGHD86o3cBYm+Z4S4cWZGbPCzSP4zu+bjOwL5gsV0kM 79GxYxPxVKF63EraKxVSsNsYuDrMF4vPFpD7uSuFxDlY7HZbRijKtoIG7VXKLiAMNlDg 1IaqWhNgvG2EfE1UradwO5buL3agrRhUtCMTPJWoBKQE+kAI29YB9G8DUDGoBrgPC5AU elMYHKfAcUGsi38Z+D38YQp8+Ba2kwQgzm5+TFSSSbQLeJraoALQyH5r5zeecRpd9dve sxdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:reply-to :from:references:to:content-language:subject:user-agent:mime-version :date:message-id; bh=PW6tS/3NKamI4e8ppXwOaU/Mpaks4ub62640Njw34vA=; b=xpT6/yn+gXlV2MS78zKQVlvZO7z4WfAvBrAGZ/kpUQss+JNd3EqAJ9XYnXF2gYF9+6 /7IxnFhLCnIRssY49KAwKNRcrxC+a4bg4zF4IQIDWAn63MeqjHXbmuGCN2FjAoPf/fDr TvyqzDJBO+DW0trO54I/JWLZeqHKNNG5rzRc+wi0bZJfFJioNFMyO1L9GVQAz55hbWUv TrIHjUFwh/BzZXNCfnYs5INmasYxYp+uGLF94jWyJWiVhV3l5whBci60zs27nPDz1790 9TvgCfoX6Lj/L4vLhashuDaWf8BpOshVt9g0GWPMydfmo3otNp35VgFF56NRCq05bZZy hWCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a50c88b000000b0046afd9f07b0si10018985edh.14.2023.01.10.05.11.59; Tue, 10 Jan 2023 05:12:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238478AbjAJNJQ (ORCPT + 65 others); Tue, 10 Jan 2023 08:09:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238371AbjAJNIp (ORCPT ); Tue, 10 Jan 2023 08:08:45 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [80.237.130.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EAA861445; Tue, 10 Jan 2023 05:08:41 -0800 (PST) Received: from [2a02:8108:963f:de38:eca4:7d19:f9a2:22c5]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1pFEMk-0006yz-DM; Tue, 10 Jan 2023 14:08:34 +0100 Message-ID: <7cff27f8-d363-bbfb-241e-8d6fc0009c40@leemhuis.info> Date: Tue, 10 Jan 2023 14:08:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: ieee80211_handle_wake_tx_queue and dynamic ps regression Content-Language: en-US, de-DE To: Bryan O'Donoghue , linux-kernel@vger.kernel.org, alexander@wetzel-home.de, johannes.berg@intel.com, Kalle Valo , "linux-wireless@vger.kernel.org" References: <19015168-c747-17b7-f0ae-9d2ee27d221c@linaro.org> From: "Linux kernel regression tracking (Thorsten Leemhuis)" Reply-To: Linux regressions mailing list In-Reply-To: <19015168-c747-17b7-f0ae-9d2ee27d221c@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1673356121;9748ed96; X-HE-SMSGID: 1pFEMk-0006yz-DM X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 10.01.23 13:35, Bryan O'Donoghue wrote: > commit a790cc3a4fad75048295571a350b95b87e022a5a > (wake_tx_queue-broken-23-08-01) > Author: Alexander Wetzel > Date:   Sun Oct 9 18:30:39 2022 +0200 > >     wifi: mac80211: add wake_tx_queue callback to drivers > > is causing a regression with FWIW, there is another report about a regression caused by that commit here: https://lore.kernel.org/all/Y6tTLPvsxh%2FIm4Ed@tp440p.steeds.sam/ ("WLAN broken on Nokia N900 with v6.2-rc1") For the rest of this mail: [TLDR: I'm adding this report to the list of tracked Linux kernel regressions; the text you find below is based on a few templates paragraphs you might have encountered already in similar form. See link in footer if these mails annoy you.] > - 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. Thanks for the report. To be sure the issue doesn't fall through the cracks unnoticed, I'm adding it to regzbot, the Linux kernel regression tracking bot: #regzbot ^introduced a790cc3a4fad75 #regzbot title net: wifi: most packets are dropped instead of transmitted #regzbot ignore-activity This isn't a regression? This issue or a fix for it are already discussed somewhere else? It was fixed already? You want to clarify when the regression started to happen? Or point out I got the title or something else totally wrong? Then just reply and tell me -- ideally while also telling regzbot about it, as explained by the page listed in the footer of this mail. Developers: When fixing the issue, remember to add 'Link:' tags pointing to the report (the parent of this mail). See page linked in footer for details. Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) -- Everything you wanna know about Linux kernel regression tracking: https://linux-regtracking.leemhuis.info/about/#tldr That page also explains what to do if mails like this annoy you.