Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp81174lqp; Wed, 20 Mar 2024 14:27:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXhbip5eg6Ps4XZniPzrEcsSdFCp5BRtxzXMMY6zxBaGTdlSQ9k+fpi+Y3iwjpVzzqykbJihaSuj2HN1oyBgQ163zUafbNAbiOWYLdCbQ== X-Google-Smtp-Source: AGHT+IEt1zefrZAXGPsbK6cTtZN//uNJBB1YYvaH1nXsMhMman9oybqKfD4KVIOz69Fw565H8apf X-Received: by 2002:a17:906:874d:b0:a46:11a9:430 with SMTP id hj13-20020a170906874d00b00a4611a90430mr12080930ejb.76.1710970035807; Wed, 20 Mar 2024 14:27:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710970035; cv=pass; d=google.com; s=arc-20160816; b=1GeGkfGp9jw5SmSWW5U6U6S3i03riJya7Kq2l2uTiXr2B+oVrYQrwRMi90ALgo3KIM Y69nu0osyX0oAmdf4dQHmf2lertsEvx8Fnq/fjm4Y3YIyNHL9kGfQfD9Bthvyvh430pz iAg9jAgL9uIgxM1JuttRx69kAM5lrZgkvqm3Naxxeqrks6zCwkr4FiBHiFl5wFQUESsc r68zt6LQ7AvpxwVSIml51jenWrLjiAoooVwROgI13GA9SYnYw7JfttaFo889EnDsKbfS RuHqsYTanP7RVs6l4RzDCWjc0d3GklnQ7aG4pcHc4ZLmiZt/unyzb4pAGFRud7nQDuWs AecQ== 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=V6lTsBjb8vIYFmbvn7z36i6rvjoKI9TX4K5z06Dzx6E=; fh=cP96cs9K3X2Q+lH/xjkrH8lK/6zZ8UeeH1/SHyTX/1g=; b=0Xd5J7hw1+LID9YeE/cN9jvWBnUjRHoopzq2JmHHfi9oNtO/KsyRZe1eqF5MekOaqk aBLug1tFrPReCVbcfpXPQvbVmqeoTVRCzpldV3eiTg/CwbP0zIxRdZIKH9UF2ZfIO1WK M0mtBT3F2y7byLtNgVlmQx6Q4WYNZwSa31QldVqhdhJsqz3l5055h/QBGnuT/A7MsZ8s M6Y5LD5zYSCTHvlvDtkNEZwe+xkGKU507Hdlgy1y/B8taMmfcOd4Fs2QjnmrpjEoFX3W hr7/MifAmsT77b8gb5bBZ1Y+FRpHnVpRnkw4vX3RnfJdK2E9h6/TjOcLniF33qj0FLHz yqZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ee1NblPc; 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-5046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dv22-20020a170906b81600b00a466b2c5d85si6394279ejb.1021.2024.03.20.14.27.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 14:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ee1NblPc; 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-5046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5046-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 54BC21F21C6B for ; Wed, 20 Mar 2024 21:27:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A8EA85951; Wed, 20 Mar 2024 21:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ee1NblPc" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 A963885C46 for ; Wed, 20 Mar 2024 21:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710970017; cv=none; b=M+zuFOnZkx+W3WN0siygXex1RkwWH/BnhO4XvNnlozZvCuHUYRGJxe2iH51cL0qpurlxm+v5H7FFkvljFAqalNYmjExVo0EeyhJ/9QCOm4HiyH1fHiBdeawOgDNTmD0w1ohBvdqrsME2JYjbBpIrc3vY6XWEcNSt9Y16TqNB4jI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710970017; c=relaxed/simple; bh=avv9ud8dXx0F1ls+X/6l7JwporMnyHH2oqTnQisLuPg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YkG84dxGx8tiuzXcPPnWSDNQXV8rDwOiz4Nieo4eYhoa1KuqNKOb9gg1QLrKxxW+RlxP7iMHdaYUqJqSooSgNBF2rV/H+AeOkTvUlmmKe9OVbogAGh6Sc/EzieEdPVBe+6k15PIQYzwrhreAJKf2iOX9mcoWaD0Krxp0LsAW6r4= 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=ee1NblPc; arc=none smtp.client-ip=192.198.163.12 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=1710970015; x=1742506015; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=avv9ud8dXx0F1ls+X/6l7JwporMnyHH2oqTnQisLuPg=; b=ee1NblPc3SRy0tsX+Afu4F/9fiITnP3N3B+lbmW/dqc6v0DCO9089o6q PJFxJ5F7LfEsTzzcmlPc8cxFvrVIlOXnCqgeCEm9UBPxXuBRBG1xJJ4w8 XiAM7CHYzj2BzmWciHROc+P9T6GbZU5KG6d9/Gn7bYPfnDU2QXTDtZyUI d4hclaSMxXGsQfRlXuuQNDaPirr0VDiveV2yF8wt+/kMCg1I7O8ds/3eq TxTvBdXoeRzqQHKtqPj0BbLoDStOSGTSFNqykWJDgUvSJUG9ZSfeXxcxt kfQ2fIa1kKL9asR1P9klMyGBNT8RvmVBXuiCNO2KJ6+LZHPUk2QZaN5h+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11019"; a="9698053" X-IronPort-AV: E=Sophos;i="6.07,141,1708416000"; d="scan'208";a="9698053" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 14:26:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,141,1708416000"; d="scan'208";a="14184116" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2024 14:26:54 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Johannes Berg Subject: [PATCH 03/17] wifi: iwlwifi: mvm: assign link STA ID lookups during restart Date: Wed, 20 Mar 2024 23:26:24 +0200 Message-Id: <20240320232419.4a3273e5c6be.I7cb6cf096ab135f4b489f2806b116563624aa5ee@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320212638.1446082-1-miriam.rachel.korenblit@intel.com> References: <20240320212638.1446082-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: Benjamin Berg When restarting the HW, mac80211 first adds the STA back with only one link enabled. This means that iwl_mvm_alloc_sta_after_restart will not see the other links and will not do the assignment. As such, do the assignment when mac80211 is activating the link for the station. Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 4ba1599ed71c..94a01c0f261a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -1122,10 +1122,21 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, } if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { - if (WARN_ON(!mvm_sta->link[link_id])) { + struct iwl_mvm_link_sta *mvm_link_sta = + rcu_dereference_protected(mvm_sta->link[link_id], + lockdep_is_held(&mvm->mutex)); + u32 sta_id; + + if (WARN_ON(!mvm_link_sta)) { ret = -EINVAL; goto err; } + + sta_id = mvm_link_sta->sta_id; + + rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id], sta); + rcu_assign_pointer(mvm->fw_id_to_link_sta[sta_id], + link_sta); } else { if (WARN_ON(mvm_sta->link[link_id])) { ret = -EINVAL; -- 2.34.1