Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp717222lqt; Tue, 19 Mar 2024 01:15:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlisPA9fP+GECHdXMsk19qWkRHQsUrDIPOlWQ1nZ3wHS4M8ZZ53YtsI4QMg/simMiZbO7RTbuhRXkPKmJGeIduOwCnvyU4bQQwgZG5jw== X-Google-Smtp-Source: AGHT+IElhw4eT7fJU+HrxVlSAPmJ71/zEZ/N+kEVjAg1ooaa7WFq5OFEexWcp2duHLPXKYpfW4wU X-Received: by 2002:a17:90a:430b:b0:29b:c13d:457f with SMTP id q11-20020a17090a430b00b0029bc13d457fmr1740851pjg.19.1710836125915; Tue, 19 Mar 2024 01:15:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710836125; cv=pass; d=google.com; s=arc-20160816; b=IUzSwEuzEFeR1o9oQH8ccx09ENBFq6GleE+m3LPeqQCK9RF2UH8o3y/d7MLaHaIRsW FegnhzBLr6lsw1dhO4aFy3+CSJrAf8czD95PwwIvbuODGWY7BTduHjs92MVrbV4hi3E8 Cq79SBSjOT7iWoRAd2B5WgUZQ697+6cMgKn6M/nMOLrz30zGTwn8tjU+BuheWMpbY9x8 2x7n6PgKyn+VRn71JidmfwupBL50Rr/tpeRQoddA1fnzAztLJUVzizI6MretZLFBr+ID x1fktmhu0xTml3linEtINlLjuKg2DPn7oqXYbCSVMOp03OGS00f30QKSCt9yEKGxYE38 FWjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=xov45kVTk3IHJ47eF85EYv7uO8sREWMfPTPcSJOQlno=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=A2peD4R0XFOP2gGsqiXE5i9xR9ruKihynM5FpUfms6pMSHpRb9TrupVDjjcldGrHPs vNyUsYDxvGDPkxw5760a8FHuB1NDSIJvEkwijPjmjZNAhPbsZ50KOKurVl7TbKQWXRfw rinLyaJ+NAlIq0y2bM2UNhT6MCHNYNq8Org0wrieZkQZbokaxs+b2rX1q2aAHNDUEkUN VEH4kHhd8PEcCqy6/UmHKnR1hqBXetMat9xF59Q/looZtbmM2MIvPSEYnLHvm/BChcOn w4ObG0mG+EQE/5E/4ZKmSisN7nFQ9JpCeNfjA542GpbOEtlwW6nQyQPYeypJiEQ3++vq hCdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fjWDR1JX; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-4895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 37-20020a17090a09a800b0029c669167ccsi453372pjo.11.2024.03.19.01.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 01:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fjWDR1JX; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-4895-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4895-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C0C10B22663 for ; Tue, 19 Mar 2024 08:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C3D37D410; Tue, 19 Mar 2024 08:11:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fjWDR1JX" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4B3A7D405 for ; Tue, 19 Mar 2024 08:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835876; cv=none; b=KEDOkXEy9Lrl33ueCCPKIChWdso5NoJm/EYfVMo/NOtRcVEBDupZdBoEVcrGPkgaUvXTzpXdodTKg0h8n2g6bQ3aQUORM0p2oRGydRdIelqQXh4sAMbWApqTePfkMb3xJRqUw03Ryru/HbYiaZdxkSU/KVoo0DKNHl2vEjqOuVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835876; c=relaxed/simple; bh=m4gdu3SsjGZk0Mj7gnTHpz00AgyeI8RSwfsICw7jdAE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SSoyN7o0Oox4qwYeNVVVXt+2DLEhsOREgMXZpCdhwsCYwluytOuAZ+Ap5pQcHVvYlPbgWSo9XiN+PjQ++VnL0ckwOLwQFotrfM+SvpZ6FdsgdczbGzaRIspmJ6GPeJ2EtmVB2PS9U6Ko2O9JqGysSmrvN9uE2bR1xplWQbyXV+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fjWDR1JX; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710835875; x=1742371875; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m4gdu3SsjGZk0Mj7gnTHpz00AgyeI8RSwfsICw7jdAE=; b=fjWDR1JXNtD/jyIuNXkl/D9krqWx3FAcxCV44J1ngbZVJiS48dVyFlR1 9uJ0zQvm+3KW+XT3tGiUufpXsrk9h/21I+ei942H7hcTDBNx8lSLKV9Ec bnGxOQyABeddZ9epk8xCBDr59JJW8FZFW9JhO5eKWg+wq02vtjz/urAte rr3xsz9+CLKC92eBzwFw4TH1bEZ2kYEzoPbv6IVl8cBoZYHJLq45xr0LB jwEbptF+acxyj6LGl4V8n4Vdt1/yiLiUHYYxTDGo2eSwhZpTDCcBvLfVu DLAAwq+0fIKwTrtk2WZf2zQYPLvpfTIjStbYQ0AnNGI4DzANS0BRdWtcq g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5810594" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="5810594" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 01:11:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="18447682" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 01:11:13 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 15/15] wifi: iwlwifi: mvm: allocate STA links only for active links Date: Tue, 19 Mar 2024 10:10:27 +0200 Message-Id: <20240319100755.f2093ff73465.Ie891e1cc9c9df09ae22be6aad5c143e376f40f0e@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com> References: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Johannes Berg For the mvm driver, data structures match what's in the firmware, we allocate FW IDs for them already etc. During link switch we already allocate/free the STA links appropriately, but initially we'd allocate them always. Fix this to allocate memory, a STA ID, etc. only for active links. Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 1628bf55458f..6f9ba0c18fa3 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -582,14 +582,14 @@ static int iwl_mvm_mld_alloc_sta_links(struct iwl_mvm *mvm, struct ieee80211_sta *sta) { struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); + struct ieee80211_link_sta *link_sta; unsigned int link_id; int ret; lockdep_assert_held(&mvm->mutex); - for (link_id = 0; link_id < ARRAY_SIZE(sta->link); link_id++) { - if (!rcu_access_pointer(sta->link[link_id]) || - mvm_sta->link[link_id]) + for_each_sta_active_link(vif, sta, link_sta, link_id) { + if (WARN_ON(mvm_sta->link[link_id])) continue; ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, link_id); -- 2.34.1