From patchwork Wed Aug 16 10:13:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 715191 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 1887AC001B0 for ; Wed, 16 Aug 2023 10:15:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243771AbjHPKOw (ORCPT ); Wed, 16 Aug 2023 06:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243794AbjHPKO0 (ORCPT ); Wed, 16 Aug 2023 06:14:26 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A39710C3 for ; Wed, 16 Aug 2023 03:13:42 -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=0VvyqyhTPSZMce5D/UwbpVXzdtNuKn0kZD0N/6hMxdw=; t=1692180822; x=1693390422; b=L9/YVDoEDG0B9xjehXS6zpBC/cLG7JLFkoTUKhRLAX7qb0brv8IhRGkHBU+rI4b7Mw6ApJQ9S0L OME8VEymC1bzIzE5dP53ZB3pJO0KHoSFeu1qaeNK32QrmmkzS/8KbSjoUMjQJLS1Gjn34z17bN4Fa to44qY5wlGpfMeD6Vi8NIxAedREpyBQrKC+HtH7rgpbRmJPWWgagrWwGYJiyz9pBjvFWTQKW2jBzH WJoSwxIWRBv1Nz52rmh74Y9crxR7IX/Ry3V0IoR8tMa1+uRT2gPXZQWXz+MziGetgbKXbXteLg3s1 NUi71RK+Hr2fAeIY8gyKT5yiQ/VGK0yXbHEg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qWDX0-00AkPH-0p; Wed, 16 Aug 2023 12:13:38 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Aloka Dixit , Johannes Berg Subject: [PATCH v3] wifi: mac80211: fix puncturing bitmap handling in CSA Date: Wed, 16 Aug 2023 12:13:36 +0200 Message-ID: <20230816121335.53810f042775.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..d354b32a20f8 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 (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; + } + ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); if (sdata->deflink.csa_block_tx) {