Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp221679lqr; Wed, 5 Jun 2024 04:18:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbGsg6xDYlSpj4EGK9VJOA+Ua69n+McJFludJtqxLLgyoiMusEb7DCClrlvuKikv6rrlgpdIe+PXhw8rXcuvl1A5I0PvdVfCxtuuIw3Q== X-Google-Smtp-Source: AGHT+IGkyQO2FHcEof7F7PzjdEvnBGz5BeB/wOZ8QZkVzA5WLwosb/a9b9Ro5rjoAWgouY3x1NWc X-Received: by 2002:a05:6a21:81a0:b0:1af:a4bc:1f71 with SMTP id adf61e73a8af0-1b2b6fbd548mr2109107637.26.1717586308166; Wed, 05 Jun 2024 04:18:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717586308; cv=pass; d=google.com; s=arc-20160816; b=lF3k1DB+D3S7WHuH84vJ17km1deBtvBfjraNLbQACdzXXIMPE/uVORAKtowEHarKjG SgmYx3dJ3U8eePzd4F1MGIpeLJKS9HJCyhyI6kOv/kECYz4eVVdIMvf7QIVERnuoZZ/y MSBNRtLZTDCLwgjaln4yECT7116L6AbZ9/rLASjC6iEVW20yt7QHshN13gX+WYRnT2Jr PgH9bSsITThE3MByFZu7i4EPAlZsd1iTriALkb979OK6BThOQJQhzXmZ227WFNWLvpOO hwW9PLGzHmzfFEmhjmb1qaP/RWVEFfjAIdleMbPfSnNT6SS7JKwkAJq/RV8Ekw578dlU Kz7A== 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=4AZfHS+Ivolv3QjT4on+NLFfrGZs0v6b4uZjHdD74o8=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=e3f9PfUQtOwubaRmUI5E+d7ON28SnFTiv2nDYjJYHZTga/zzajbdqyJE6XQTJCQs0f S2Yr35QCD4e8i/I5OtB9VW6eE3rNj8dBpgPKZIA69nQa86rj3+lZiCNdYqPQF+8PzmVO f7S6tBrb/11eA8WXk9AOxK0eX/6PMv7fAAw04QKMDFHEXHFz0n9U7Z2Y6DCwotWOP5lF T+yiFSC56+htPTrJSM8HMZgUA3KksAWF/sYY3QflGQBPkUxCLqJXiHKBlEloUOPcSWiD Kq0fsbLILFRpzrj7+9MI1IYT3AA5KAatJA8521qkxTtWR8SlspUdT4pOcsSjCCwUKiK9 k0IQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T8ushLUq; 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-8550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8550-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c28067e29esi236401a91.83.2024.06.05.04.18.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 04:18:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T8ushLUq; 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-8550-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8550-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 825B0285C34 for ; Wed, 5 Jun 2024 11:18:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60DC5194132; Wed, 5 Jun 2024 11:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T8ushLUq" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 11F1019306C for ; Wed, 5 Jun 2024 11:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717586244; cv=none; b=LpVMmK+L23Yejizgl7GfQcX6xUNhDQfU1PZUy181YrRGA0QbzWIUMTaHOnDqz9eBiGrVUwd4p5NJgYmpPGp6eitR6JijmyVjatww51V5y+3BaGsiwYKrMfxgAlBuyq8kTjT5EoAlGyq1onAhpiDBVgvhB/KByNp8r35CYjYb7hM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717586244; c=relaxed/simple; bh=oqs8DQ9zpniAk7C9rCPfB2RgXLx/iPT/OXGpGu0g8DM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jlZE/2elR2dEIXeU6qglbLR0bxUSDTKZ74B2fFFaB7SwZ6c5sxCH3JhJUQHttWqJk/RszJKNkdY1rE/BuBrV8agXKICm3m5jah0x0osPy0rx8kEsWh877oKtP9Qwbr6e2bSja6aV6nupQs5dpnfVgrKG+e3MjDjX4c54oiHEy9I= 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=T8ushLUq; arc=none smtp.client-ip=198.175.65.9 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=1717586242; x=1749122242; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oqs8DQ9zpniAk7C9rCPfB2RgXLx/iPT/OXGpGu0g8DM=; b=T8ushLUqjtJfEhenpj1HSknNCKzF9HX1MrYUMDIZEzBmta8Rdh42g70v qON8fsfsysPaFX2e3+rR0tSgOaLE4IvwbpTVO0+hHWEdOoQ7313XxYkQ2 TDqNlz2B/XOeff00jqytYbEWoXlbarTxi4WyKrcBJnvwjmIKKpz4J4o7I t+kRiwsrYnyoFzKfcksyF7xMCUZ402m18pFwfzW/Fmbri/0L2deODhrvf It4nnundN5RjsGnMN+eAMdnCF1pAsbBMJAs44ysp8GgNiz/qoBOrhIfsh wfdqfEbpMlXAzXZPsSHkJqthMBUdX5N+SB6Zi3IsZLsB8exCxHKD5pUc+ g==; X-CSE-ConnectionGUID: mPYyy51uQmasQE7MuJcWVw== X-CSE-MsgGUID: S0XthvZKTpK9rnfoOszCMw== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="36718038" X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="36718038" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 04:07:48 -0700 X-CSE-ConnectionGUID: /1EcKUgzSimntUTwmPCeyg== X-CSE-MsgGUID: DO6JjO29RauLHrMPsbBRSw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,216,1712646000"; d="scan'208";a="37433755" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2024 04:07:46 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 1/5] wifi: iwlwifi: mvm: separate non-BSS/ROC EMLSR blocking Date: Wed, 5 Jun 2024 14:07:36 +0300 Message-Id: <20240605140556.461fcf7b95bb.Id0d21dcb739d426ff15ec068b5df8abaab58884d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605110740.2046411-1-miriam.rachel.korenblit@intel.com> References: <20240605110740.2046411-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 If non-BSS and remain-on-channel (ROC) blocking were to occur simultaneously, they'd step on each other's toes, unblocking when not yet supported. Disentangle these bits, and ROC doesn't need to use the non_bss_link() function then. Fixes: a1efeb823084 ("wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +++++++--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 5 +++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index a2a0409672c3..d2b97e30d9eb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -4787,6 +4787,7 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const struct iwl_mvm_roc_ops *ops) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); + struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm); u32 lmac_id; int ret; @@ -4799,9 +4800,12 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, */ flush_work(&mvm->roc_done_wk); - ret = iwl_mvm_esr_non_bss_link(mvm, vif, 0, true); - if (ret) - return ret; + if (!IS_ERR_OR_NULL(bss_vif)) { + ret = iwl_mvm_block_esr_sync(mvm, bss_vif, + IWL_MVM_ESR_BLOCKED_ROC); + if (ret) + return ret; + } guard(mvm)(mvm); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 82080d920d59..cb227dca4f87 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -361,7 +361,9 @@ struct iwl_mvm_vif_link_info { * @IWL_MVM_ESR_BLOCKED_WOWLAN: WOWLAN is preventing the enablement of EMLSR * @IWL_MVM_ESR_BLOCKED_TPT: block EMLSR when there is not enough traffic * @IWL_MVM_ESR_BLOCKED_FW: FW didn't recommended/forced exit from EMLSR - * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-bssid link's preventing EMLSR + * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-BSS interface's link is + * preventing EMLSR + * @IWL_MVM_ESR_BLOCKED_ROC: remain-on-channel is preventing EMLSR * @IWL_MVM_ESR_EXIT_MISSED_BEACON: exited EMLSR due to missed beacons * @IWL_MVM_ESR_EXIT_LOW_RSSI: link is deactivated/not allowed for EMLSR * due to low RSSI. @@ -378,6 +380,7 @@ enum iwl_mvm_esr_state { IWL_MVM_ESR_BLOCKED_TPT = 0x4, IWL_MVM_ESR_BLOCKED_FW = 0x8, IWL_MVM_ESR_BLOCKED_NON_BSS = 0x10, + IWL_MVM_ESR_BLOCKED_ROC = 0x20, IWL_MVM_ESR_EXIT_MISSED_BEACON = 0x10000, IWL_MVM_ESR_EXIT_LOW_RSSI = 0x20000, IWL_MVM_ESR_EXIT_COEX = 0x40000, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c index 31bc80cdcb7d..c0322349bfcd 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -47,6 +47,7 @@ void iwl_mvm_te_clear_data(struct iwl_mvm *mvm, static void iwl_mvm_cleanup_roc(struct iwl_mvm *mvm) { + struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm); struct ieee80211_vif *vif = mvm->p2p_device_vif; lockdep_assert_held(&mvm->mutex); @@ -119,9 +120,9 @@ static void iwl_mvm_cleanup_roc(struct iwl_mvm *mvm) iwl_mvm_rm_aux_sta(mvm); } + if (vif && !IS_ERR_OR_NULL(bss_vif)) + iwl_mvm_unblock_esr(mvm, bss_vif, IWL_MVM_ESR_BLOCKED_ROC); mutex_unlock(&mvm->mutex); - if (vif) - iwl_mvm_esr_non_bss_link(mvm, vif, 0, false); } void iwl_mvm_roc_done_wk(struct work_struct *wk) -- 2.34.1