From patchwork Wed Aug 16 08:04:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 714363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EEBAC001B0 for ; Wed, 16 Aug 2023 08:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242642AbjHPIEg (ORCPT ); Wed, 16 Aug 2023 04:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242526AbjHPIEU (ORCPT ); Wed, 16 Aug 2023 04:04:20 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53FDFAB for ; Wed, 16 Aug 2023 01:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=6UMLbhNbdypZ8C8BdQK3EcWirRD95iFojQCclvxCv48=; t=1692173059; x=1693382659; b=VOuNBRbJ5H7Lfigw/fHiE5L4GtxEek5VKDy7l7/MX7gwWN8x0BkXpeh7rOUGe/cOHAKQ3yn6rlO yyDX5JqZkIFf5FhlXmE7BHwKsAwfuC7/1fFnHtPzeMmANHhi+I5IcIyiX6Jarn1BlayWrfBPZLSJa nrOJ77/gPXtCzI81xncEGvN0rUf6R1YiAl7qEd6umY4ir/TRjqEY9yBlK4GwvW0YI/n0H7trmHCTA 9l6Lom5fx57muvi3mY5lgy6Z7E4Cl3GtLm1yPBpFN9RZX0d1EwJ2thmpw221FRActsp70kdHSj6rj nMJMa4+CLZSMN0XVWX/smPMtIO/Bigu9WnlA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qWBVo-00AbTO-1r; Wed, 16 Aug 2023 10:04:16 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Aloka Dixit , Johannes Berg Subject: [PATCH] wifi: mac80211: fix puncturing bitmap handling in CSA Date: Wed, 16 Aug 2023 10:04:13 +0200 Message-ID: <20230816100412.e2677a05ffd3.I062e026efafb59b026ab72fc7f7fce54f43dd29b@changeid> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg Code inspection reveals that we switch the puncturing bitmap before the real channel switch, since that happens only in the second round of the worker after the channel context is switched by ieee80211_link_use_reserved_context(). Fixes: 2cc25e4b2a04 ("wifi: mac80211: configure puncturing bitmap") Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index e7ac24603892..1657ff09a83a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3648,12 +3648,6 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) lockdep_assert_held(&local->mtx); lockdep_assert_held(&local->chanctx_mtx); - if (sdata->vif.bss_conf.eht_puncturing != sdata->vif.bss_conf.csa_punct_bitmap) { - sdata->vif.bss_conf.eht_puncturing = - sdata->vif.bss_conf.csa_punct_bitmap; - changed |= BSS_CHANGED_EHT_PUNCTURING; - } - /* * using reservation isn't immediate as it may be deferred until later * with multi-vif. once reservation is complete it will re-schedule the @@ -3683,6 +3677,12 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) if (err) return err; + if (link_data->conf->eht_puncturing != link_data->conf->csa_punct_bitmap) { + link_data->conf->eht_puncturing = + link_data->conf->csa_punct_bitmap; + changed |= BSS_CHANGED_EHT_PUNCTURING; + } + ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); if (sdata->deflink.csa_block_tx) {