Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3683325rwe; Mon, 17 Apr 2023 01:45:30 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+EVWetbgzdMygHoNdC+mfgGPf7I2CZvNluTXoRXLejXADyZ6EKOGmenfc4jnZ30Kw58UQ X-Received: by 2002:a05:6a20:bfd3:b0:d9:2d4e:c08c with SMTP id gs19-20020a056a20bfd300b000d92d4ec08cmr11762025pzb.61.1681721130138; Mon, 17 Apr 2023 01:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681721130; cv=none; d=google.com; s=arc-20160816; b=QA9yxBQIKSydHDgX4l4EBBKFbmrZ9+JvE5i7774OMcc/SPIkE8priAt4/uGRLjNa/L NBlMYo/QSLFAxnQjRmJ1YPoF0PBbfNdoJF5oGEKNynPDS27bQrYJ1JCi652hG1FWCdCz z/ZGmKvHfD9TfrOlepWcp/2rG93m5MCS/Xiq/0qgJset8gJpwWVAiGT4TLtGQ8tFKqYX wBk+x1c0IjV7qQQLO1PnhCmPK2vx6a6YkFz5cREg0FU3WbRNgQ3jfsKL9qwkOujT8D2H RFp8pxB81XpenDU+xTzMCIZj/8Jt0bvbJigK9neB3qvuNWclWeoR7tm3IUD9D57+3ddC Owqg== 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=UnbNH5tN9Exf61J6uHHYFMqUTW4qpuz2lLKhUThNGfo=; b=exIMvzkccCo17MrTm1GX8hK3mebSTedUhvLFV57sxweWv8M+nT7J3UyVyWnXdD9en+ WvMlvzPML4/Ou5u7rBi0bqxtkF/xi6TUwtfNjta8WeqLBxAPDhtOrO4tOxOBKNGVzgv+ IXdWHkX2PH2UkzVrSYO1ZXEeWgiVj52jN4i1R0mkqUzfRJKIcbc7cWqZkvTW4LePAKaa TrQg/nx60WMZIsE0F72tko8MGql6YELgk5jFZ765lV/nYRNAtOhEJEGWaccyKdtZCgSp nD5nUBxNX7I0S0zwAAJI1mijt/yoeCACV+Fl+er2ePW8yqLJbtMNe47vQj49Fzye1Ufk 75XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=E0g+ZRRN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a634517000000b0051460989406si11302514pga.605.2023.04.17.01.45.16; Mon, 17 Apr 2023 01:45:30 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=E0g+ZRRN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230049AbjDQImO (ORCPT + 63 others); Mon, 17 Apr 2023 04:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbjDQImK (ORCPT ); Mon, 17 Apr 2023 04:42:10 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0084B44B2 for ; Mon, 17 Apr 2023 01:42:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681720928; x=1713256928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f2Gp2h7kn8M70T11hZPktaS9QbKRWXZwF19oTCfEfu0=; b=E0g+ZRRNT1c5SXpd4QUmceH4d6vnK4budZjR+DyN15QO9zfOWkLHpFC2 6VRQpOwKGtMQzmtPs9WqVdFRUclCO/Gre3lPgAq9UCO6SsZ4kQu0J0/oW ct0MqkwPIyZN9D+dOtxpsTZF6vb9jvDKpoMscx7OBBoLk4oqatrq8lDr9 lQyUoU3cPzq3wkI5UlrG1MqvZXZkW1/pH0zDW9gEm4t+xeG8gZYsjdymI 9Ri8Vcjq+ChBkL/dd1RjIRJvOtXfWs70pN3GKCBdEloCOrBXK5PuIH1jQ +vTf1ed1j1Z4nsCexjw0MBE0YdyUxHpjoqV8GGGLHtbb5xMLHZUXxjzjg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="333634350" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="333634350" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:42:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10682"; a="693173835" X-IronPort-AV: E=Sophos;i="5.99,203,1677571200"; d="scan'208";a="693173835" Received: from odotan1x-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.202.32]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 01:42:03 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 06/15] wifi: iwlwifi: mvm: fix iwl_mvm_sta_rc_update for MLO Date: Mon, 17 Apr 2023 11:41:25 +0300 Message-Id: <20230417113648.fd47d0de8319.I87c5e5bcb2fadd70acc32021eed394fc1eea12a4@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230417084134.1338976-1-gregory.greenman@intel.com> References: <20230417084134.1338976-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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 From: Johannes Berg When this is called it might crash due to the use of deflink's phy context, update all links instead. It really shouldn't be called right now though, but it's better to have safer code until we update this to be with a link parameter. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index b086229f339d..9d5d2c6625a9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3585,9 +3585,9 @@ static void iwl_mvm_rs_rate_init_all_links(struct iwl_mvm *mvm, for_each_mvm_vif_valid_link(mvmvif, link_id) { struct ieee80211_bss_conf *conf = - link_conf_dereference_protected(vif, link_id); + link_conf_dereference_check(vif, link_id); struct ieee80211_link_sta *link_sta = - link_sta_dereference_protected(sta, link_id); + link_sta_dereference_check(sta, link_id); if (!conf || !link_sta || !mvmvif->link[link_id]->phy_ctxt) continue; @@ -3983,15 +3983,11 @@ void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, u32 changed) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); if (changed & (IEEE80211_RC_BW_CHANGED | IEEE80211_RC_SUPP_RATES_CHANGED | IEEE80211_RC_NSS_CHANGED)) - iwl_mvm_rs_rate_init(mvm, sta, - &vif->bss_conf, &sta->deflink, - mvmvif->deflink.phy_ctxt->channel->band, - true); + iwl_mvm_rs_rate_init_all_links(mvm, vif, sta, true); if (vif->type == NL80211_IFTYPE_STATION && changed & IEEE80211_RC_NSS_CHANGED) -- 2.38.1