Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1879437pxp; Mon, 21 Mar 2022 06:58:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd+zMu72BcwlokHIGGYJ72NzFbQP7L7enM+KjGZlx/ia3zbqqre68XlC8cf2zV/AM3WZrd X-Received: by 2002:a17:907:da7:b0:6df:9ff4:10c7 with SMTP id go39-20020a1709070da700b006df9ff410c7mr17954445ejc.106.1647871130860; Mon, 21 Mar 2022 06:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647871130; cv=none; d=google.com; s=arc-20160816; b=s91tk5d7G/vvQcFu2W5nu7u8xwDV7GUTFPcgC1ZVjQ3COyxb6BiecRsil96caMnFL3 u5c+E2w5CLCHL12V+F4xlfKxDhr6mpFPC4b/ySN7BgjftN3LvnvcGYLEGkBh0rcpks01 YPGtXQ/W1jdxVHSzh0RgURH5EKN0/JK6ETOE7k2mmu81fClMM0NdBM4ek1jPXSNeRnmR X/fg52qMLhZZAcG4iPCrA78rls2XvY7CTtJxaK1aVO6qmPWp4h913P+SRJtpRIAlPvCK /B5jYEPsFQeNsOJb7JZVPOGESZCo9FCdSy4mS75Y8OzKSBmG41UoqW4Bt57pZ7jF5G8m J8uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=UWbXEqchSGo9riC38/sQnKdeDqcZUzExMZARH5pa9fY=; b=qkl/cmYLdnS3nBhdV0Tcxr0d4B864pm/qwEePg+xuJj3BR5rA7l/pyxadM0EDtyEr2 iNpAyGIOkq4wakNZaYWvBsf/VIVc+mSqmRQQrBLMK8RlDs57piiWDfpbpWNW7CvFJ4GC lCKmzlye9Ema/SEU743g/9Luchvt3zaHjcvB2BpQQJHq1P7zNxxza3wkQj+zhyqzCbIJ 5LUquwAal33bQWJnELX/6o9Qbf8zDWkKs+wOSPBZizP2NiFeSBRlkOQPCX5xrAcjtqLU EgR03kKQbbpRPI+6qeRu00ZI8eHAib8dIsF0TZAdktcuhCma/QwZ4xOFZdhiWrs/aA29 gU3A== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a170906284600b006df846edd5fsi6229555ejc.998.2022.03.21.06.58.32; Mon, 21 Mar 2022 06:58:50 -0700 (PDT) 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241274AbiCRWTq (ORCPT + 70 others); Fri, 18 Mar 2022 18:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233444AbiCRWTn (ORCPT ); Fri, 18 Mar 2022 18:19:43 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87BEB183836 for ; Fri, 18 Mar 2022 15:18:18 -0700 (PDT) X-UUID: d8c01a71268f43efa11bdd66a23fe154-20220319 X-UUID: d8c01a71268f43efa11bdd66a23fe154-20220319 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1027730250; Sat, 19 Mar 2022 06:18:12 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 19 Mar 2022 06:18:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 19 Mar 2022 06:18:11 +0800 From: Ryder Lee To: Johannes Berg CC: , , Ryder Lee Subject: [PATCH] mac80211: adjust the replace_state of ieee80211_find_chanctx() Date: Sat, 19 Mar 2022 06:18:10 +0800 Message-ID: <40aabb3e10302f1d7da92b7a4eb46577d5ed8e05.1647641256.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,MAY_BE_FORGED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR, UNPARSEABLE_RELAY autolearn=no 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 We observe that the condition of chanctx could not be back to IEEE80211_CHANCTX_REPLACE_NONE occasionally while STA connection. In this case the state could be IEEE80211_CHANCTX_REPLACE_OTHER, which fails the check and then creates another chanctx that leads to the next round of chan_switch failure in cfg80211_check_combinations(). So, modify state to just rule out IEEE80211_CHANCTX_WILL_BE_REPLACED. Signed-off-by: Ryder Lee --- net/mac80211/chan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index e26d42de14ec..604095ff7a5b 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -477,7 +477,7 @@ ieee80211_find_chanctx(struct ieee80211_local *local, list_for_each_entry(ctx, &local->chanctx_list, list) { const struct cfg80211_chan_def *compat; - if (ctx->replace_state != IEEE80211_CHANCTX_REPLACE_NONE) + if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED) continue; if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) -- 2.29.2