Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2254825rdb; Thu, 21 Sep 2023 13:02:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFafPX7XIMj3LvRMRr02Xn8a302WdRZQ6wOTEJnK/iXYS2xaRwd31enDCAfBe/FuDTslnLK X-Received: by 2002:a17:902:ab48:b0:1b7:ca9c:4f5c with SMTP id ij8-20020a170902ab4800b001b7ca9c4f5cmr690841plb.28.1695326564213; Thu, 21 Sep 2023 13:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695326564; cv=none; d=google.com; s=arc-20160816; b=f9kdrbwoDcGaf5EKiYc6oKiXMi4MSgS3Wc/ZhKjrIVU4Wh1TgGSASyDEzSY9IdMeq9 7XOQNZROfgUbDBPDj6fdnF9+RoQMwUu/sa0cpOrnPn4I8xbFEd/0cGhD3vJnvVEaWO9Q pk6jCF6nxRwbVjGLngL2o99rxEexPqwsLkBbLFIevAGM58w+nsfW8uNT8cPYH6aSHn9M XIpIefsPqRm6pCN107z8ieBpdwVgfhyUqD+WWHhGPK2d6FB0HZOhsldYdZnmchPQ8eB9 ZoaKDnOPVeRAq4soXMUWi3uulECUGNtPiB+GARDEsTc6j2y0QO2XvUJH2IdNlqVfbPIV 0pFQ== 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=JwvhDVbJ3RGkihkwiYGvAKtbaNIFgNZluzpZgHbirok=; fh=Y2IfAqdjkYQAx7XZcGq/8JceY1atOOwfX771vvMvH7o=; b=q1H7TbBJsVhGHs1X4+LNlSP91kE3mhtwUHPie0pJo3FOO/t8ImTIDJq0xQX7q3xtI7 kSPsH1NE9b7LdJ45u6bP4eA+bI1MYDi6uFoFTMmqBBaoC3ZrZJBacGsRNiuRcKDn+oVJ P+k2gYbKWYKImoeaBwN8gOK0PdZMsPOC28ugzvEi+NsWoxV07ePCeD6QVRkpNIyTun3O eCi1hMO8TOMKWm//n90gKwRD6J18acNGKLe7Ca54iz9frUiHYmJHE/Lo3D7pQWpb37CA p+0v/6a2StUNmB4rfS92hqr999LFrCXzcSxme0ilCdSMBZIus8K1YLAJHg3DvFw3hpfT mkjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hGwcDNeu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ld5-20020a170902fac500b001bb6d711625si2027901plb.279.2023.09.21.13.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 13:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hGwcDNeu; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 5CD1F812E348; Thu, 21 Sep 2023 12:50:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229560AbjIUTu3 (ORCPT + 56 others); Thu, 21 Sep 2023 15:50:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbjIUTo3 (ORCPT ); Thu, 21 Sep 2023 15:44:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC345A554 for ; Thu, 21 Sep 2023 10:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695318624; x=1726854624; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ez6OMbG56Oz+kGhavzXmhZUc+zxBbDsBUtxINxLSAeQ=; b=hGwcDNeuDgm6JZdwxDPAyjba0q9y9mwxuvyVb1IxOdGvZyjvEZQ3d0a6 wtLYTU0f0NX+yUpKTb9zYHZFG7tBHTvnbXel6iO1weCFIOzPzDC0rQgWP CjtMz8tlVUJmmr9lU0xYp2i+iHfwGh2uTOERjHoMeV772DokTArICkbT0 i2+5OVMDEfuUq2ddv0suLMUiMi89GOgpkhADSCSZXYYUF9dOH1TUT3x0o r/1Zxz3Ttv+km18EuJ7Py7lqlsH4x6Wq0a9QhPXjihgX8efM4JwICpuCy Sr2FyjmoLmjBnRLSZaKHe7/4sE4WbPl7crx3rhGvawqq4chVkYZEYO8ph w==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="384305312" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="384305312" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 01:58:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="740545519" X-IronPort-AV: E=Sophos;i="6.03,165,1694761200"; d="scan'208";a="740545519" Received: from rchuwer-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.229.163]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2023 01:58:49 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 03/12] wifi: iwlwifi: mvm: handle link-STA allocation in restart Date: Thu, 21 Sep 2023 11:58:01 +0300 Message-Id: <20230921110726.99b7cc754b00.Iaa0503a3100250489fed8b4bdcf60e24a96d3392@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230921085810.693048-1-gregory.greenman@intel.com> References: <20230921085810.693048-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:50:55 -0700 (PDT) From: Johannes Berg During HW restart, STA link changes happen while the link-sta is already allocated (had been prior to the restart). Adjust the allocation and checks to handle that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 524852cf5cd2..4e9d19eb31f1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -1104,15 +1104,26 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, link_sta_dereference_protected(sta, link_id); mvm_vif_link = mvm_vif->link[link_id]; - if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta || - mvm_sta->link[link_id])) { + if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta)) { ret = -EINVAL; goto err; } - ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, link_id); - if (WARN_ON(ret)) - goto err; + if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { + if (WARN_ON(!mvm_sta->link[link_id])) { + ret = -EINVAL; + goto err; + } + } else { + if (WARN_ON(mvm_sta->link[link_id])) { + ret = -EINVAL; + goto err; + } + ret = iwl_mvm_mld_alloc_sta_link(mvm, vif, sta, + link_id); + if (WARN_ON(ret)) + goto err; + } link_sta->agg.max_rc_amsdu_len = 1; ieee80211_sta_recalc_aggregates(sta); -- 2.38.1