Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp741865rda; Sun, 22 Oct 2023 07:56:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9tx7QZ+DJDQ9DOwmgGX/INeXcLzbgIWSPDGwoPzCHcnD1pQXNdI5oFHaYy2N5kZkbi5gS X-Received: by 2002:a05:6a21:7746:b0:159:6b5c:5653 with SMTP id bc6-20020a056a21774600b001596b5c5653mr4715436pzc.37.1697986597387; Sun, 22 Oct 2023 07:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697986597; cv=none; d=google.com; s=arc-20160816; b=BFq/mCY0rmtW4xWizIRtA/nrU1+Z4pzhFabmYCCPBrD4c3Acmq+i9I6afMt249Rurz W4Zn3vDOgpgaTzfOpl/ey60aERHvdQdF5WNaMf38AU7bo/emmqB42Z8iUgVB6axefaqQ CyIJKKA2UoxZ1zl+6Hdy785j7gVqGpKTQTnE5KZJmfzpbUMW7GcBT5klVuv6H8TOp5PI DMRKPGntyOg+CuBfIKBZ9fD8mPcU9tDr/WMY+RySWGENP6Ykh2EwV46TpUoqNzBSLUSO j067zLZn27JQ2ndWd1BdO+GKeeWogbXzjk3IAQrzqtY/+deridzVtaFGVZ8tIKwd2p4k AxKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FHIvt0/Y8k1yq+xPSbtBqpMkIAbCOF0niWwDSXostB8=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=R14h4Oh6xmhFx01PIux7mSHDl4de6RY/p9tqx1M2ZuWfdzVCMojeA+SgWUSKnfNO1z zs4U14HJSpGYbBQcuU0FuTIOBlVC809cI41xmeaSRhkh+zt5EHnyuEXtbcin8U/UL1PW ji739pZh1PzkVSQdNeeA0rgYSlOS3il3FLdQTA5w/54FLxvuykl5l7ixf1de2uDE8dxZ BLM9LslFlPwgXn6L5WM5+Yzjnmau7yfPKUSlQACbVt9xjAHw5nVR/nGoLhZbMkcEJ+5l tFEYj8yxJFrPbe1MMoKHZnSZ1L9dGg2Uk3VMckFhcAYuEedKDRC1UcFPF8PDlGyY6AhH w1Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gvvwyt3t; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a23-20020a170902b59700b001c9ff840285si5009128pls.414.2023.10.22.07.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 07:56:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Gvvwyt3t; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 887F4805A785; Sun, 22 Oct 2023 07:56:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231801AbjJVO42 (ORCPT + 52 others); Sun, 22 Oct 2023 10:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232093AbjJVO40 (ORCPT ); Sun, 22 Oct 2023 10:56:26 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F305124 for ; Sun, 22 Oct 2023 07:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697986585; x=1729522585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YO7PfPZC43Y7b5fo7CnjpkDRUfR51Ue1oSBb1PzIujA=; b=Gvvwyt3tlZOUD7oo3lCXN2nf732IXTwoOUOzZKzOfknbYSs/0KVgFny9 S2EGxVSwdsV3kxQ4UXqO4JAkAKv9JHRCgxoM68vHyePz3aqZPORPXe5DO yBVB1wFm1o1si1FBZeVRVtz6/N3Ga7Ok6V6BmYxXHeo8300WnTAFvFgfv 7Ye027Mso3kaDJ+XRsp7VqqnWvS/s3O0R68zjf+oi+traz1mEYMWKjKBQ 1QhahUwxsObJ245P32qA8frAaNik2ReXnKyguW20n2KDqmjwEay76Ek4s IhItKweBLcfzHEpKzTelvLUn8Ful4xUfdHbahK5hkXMiLaSjHJXUma7aR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10870"; a="472925860" X-IronPort-AV: E=Sophos;i="6.03,242,1694761200"; d="scan'208";a="472925860" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2023 07:56:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,242,1694761200"; d="scan'208";a="5556212" Received: from umark-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.231.87]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2023 07:55:08 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 07/10] wifi: iwlwifi: mvm: cycle FW link on chanctx removal Date: Sun, 22 Oct 2023 17:55:53 +0300 Message-Id: <20231022173519.90c82837ba4d.I341fa30c480f7673b14b48a0e29a2241472c2e13@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20231022145556.244202-1-gregory.greenman@intel.com> References: <20231022145556.244202-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 07:56:36 -0700 (PDT) From: Johannes Berg When the vif is in MLD mode, we'll get a vif links change from non-zero to zero on disassociation, which removes all links in the firmware and adds the 'deflink' the driver/mac80211 has. This causes the firmware to clear some internal state. However, in non-MLD mode, this doesn't happen, and causes some state to be left around in firmware, which can particularly cause trouble with the ref-BSSID in multi-BSSID, leading to an assert later if immediately making a new multi-BSSID connection with a different ref-BSSID. Fix this by removing/re-adding the link in the non-MLD case when the channel is removed from the vif. This way, all of the state will get cleared out, even if we need the deflink, which is more for software architecture purposes than otherwise. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index c953824f55ef..ff6cb064051b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -462,10 +462,17 @@ static void iwl_mvm_mld_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_bss_conf *link_conf, struct ieee80211_chanctx_conf *ctx) { + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); mutex_lock(&mvm->mutex); __iwl_mvm_mld_unassign_vif_chanctx(mvm, vif, link_conf, ctx, false); + /* in the non-MLD case, remove/re-add the link to clean up FW state */ + if (!ieee80211_vif_is_mld(vif) && !mvmvif->ap_sta && + !WARN_ON_ONCE(vif->cfg.assoc)) { + iwl_mvm_remove_link(mvm, vif, link_conf); + iwl_mvm_add_link(mvm, vif, link_conf); + } mutex_unlock(&mvm->mutex); } -- 2.38.1