From patchwork Mon May 6 07:04:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795184 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 97D68524AE for ; Mon, 6 May 2024 07:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979073; cv=none; b=QT6mg9qNPD+dpsK4K3baFTIo8gP16+bzame+Dmh7fyHmr+ZJKguFJtf+STCa3J5E9Y2tWWoPTHNl0Mm5J84Tungt6aEWIZUc+3N3hOmt3/OTkFan6EnUBLN98+N6WuhrNURfYxBIp1zygg+cMDhEGiG2kdzS/wLxxwpOq8gO0ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979073; c=relaxed/simple; bh=Hi4BDeSPRAiODk56O95/3/fxkoo18zgixTcnLoXqqUI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y+TdlVB66F2f4xNRygMUbSQXZ6Z55qbsY6d8uvesb7LJp/iqG9IwCJfS/HY8C9XxQwkWgVgM9xJp2cnAHdRB371QF6CLtIF7lPapaedRt8+I+clxhUPgoemgGonJbpvxrz2Yb6lMgKXJfIoNezgcnur/Y5I363anYMljBHhojWI= 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=bgOasywn; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bgOasywn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979072; x=1746515072; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hi4BDeSPRAiODk56O95/3/fxkoo18zgixTcnLoXqqUI=; b=bgOasywnOV8s3n9nUoS5vStcxQ6NjXT2Kt6yApxJkd4bIQxhUMV0/6d+ TV9ScHwsXsB2ZrZAPX8ZAYrb2ry0oKT+GSOxkyq8BPhshA7S9OsFRnvvs 3ezq8Oj2yup9YO02SVUfIjgquFQkoI1RFGdfGo03ViiCxVWmqmOBO5Qon zYYZ+f3Xc3QlkhCO6Pp3mPLnfBkWAjVlyQsNUa/JXcIOOWS8bJ38FOrat ++eiNqhQUgvQ4u00WWIMVzdaO/u7j136sBeWIzHdnGbv71VnKjcDxclOs iyPMuoqhghtykBFPEqpa//ipaGTm6n73hDCi4jobC7JVX+3RlhRXalT91 Q==; X-CSE-ConnectionGUID: hv+6SW5WSG2rLazD7Tkt6A== X-CSE-MsgGUID: Ajg2Lp5tQMOXjbzXQNK2fQ== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638153" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638153" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:32 -0700 X-CSE-ConnectionGUID: yVqy1g7JRmi9gUCVFIqNlA== X-CSE-MsgGUID: ERNn4i8wRA+yLmTOYAHvmw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264867" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:30 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 02/15] wifi: iwlwifi: mvm: fix primary link setting Date: Mon, 6 May 2024 10:04:06 +0300 Message-Id: <20240506095953.779bf6949053.Ia9297991ff2fdc82ae7c730e0069e2dd6e5f2902@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 mvmvif::primary link holds the ID and not a bitmap. Fix this Fixes: 07bf5297d392 ("wifi: iwlwifi: mvm: Implement new link selection algorithm") Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index bceafd551e8f..0a3b7284eedd 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -1212,7 +1212,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, * Ensure we always have a valid primary_link, the real * decision happens later when PHY is activated. */ - mvmvif->primary_link = BIT(__ffs(new_links)); + mvmvif->primary_link = __ffs(new_links); } out_err: From patchwork Mon May 6 07:04:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795183 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 6C8A85338C for ; Mon, 6 May 2024 07:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979077; cv=none; b=EJ6SkNb7AX93O5OS3XWEouFCBrF8oeHzaPRhNPj8vq1Bi1BhNtgM1D7QDHggEwCfg1xtuOFkZxGytZsLqfWjA4jOhA/D1cQOcAPkjdtes2XmD3q84c5D+pj12Z+QJEQmzQIn8mNoBV9rfYpJg7tMTkspfZ5PF20pfEApA9GCrsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979077; c=relaxed/simple; bh=9+w4tbf2P1oZuyqL6uqj6BLPx+t2wTdP2J0hca9hB40=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VS18n8bCM4NIm4BRfXV4puexrRY1yy6Y7RiNZF1U6RKvEBPt8AU/cI6xVfRjimysxqID5nTktH3hpqtEruvoB1YkuiCV+FxX5L3G4nFTBXSoa8VQz6TEQKMtMFSBLOsuMHn3hUROXBuTLDhSBdhTfkx0wTayxKozJ89MuXDT6+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=jxchMeI3; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jxchMeI3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979077; x=1746515077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9+w4tbf2P1oZuyqL6uqj6BLPx+t2wTdP2J0hca9hB40=; b=jxchMeI3k+ADrThQ1O24LF8D3Cma0WHDUjBK/ileb6eP86MXWo7rM6oI 0akD32coSCzaonq2Gvn4PXzBPkOkGA5BiU1r2+I35+u2gh5T1DJ4lXYNH PNBQ9+zL2BI72bXClUfm17HkH3du22QrH4OQQNVflV9HugfVe6VDAzSfF tu6D2e0yIRkRw/vxmnslymaMx2f1RUAyrfeKrbFmycybp7ldeKXw8hAbG SsrTWDcHBxQSZendYys9DiJ/aj7aty2cxqgqJZ0zlbbLxTIoEDwckjnKK bAXt8+fATs5XXAp3PpSRH9tayWG1HYOkTnE8SlVThw/I39IEow4mqHxXv g==; X-CSE-ConnectionGUID: /g7hRdcMQHWxv2tmCmedpw== X-CSE-MsgGUID: eX0ufEkPRCSRemDid+Cl3Q== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638173" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638173" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:36 -0700 X-CSE-ConnectionGUID: Hj0XpNv2T2awzG3Xgt9UGA== X-CSE-MsgGUID: dPAilluVS7KOZutT2/yGiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264900" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:34 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Yedidya Benshimol Subject: [PATCH 04/15] wifi: iwlwifi: mvm: Add active EMLSR blocking reasons prints Date: Mon, 6 May 2024 10:04:08 +0300 Message-Id: <20240506095953.1e34fe2c3e51.Ia7db0392d81818ceb70a7b199d3f5fa8a4ad198d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 From: Yedidya Benshimol Upon adding/removing an EMLSR blocking reason add to the print the EMLSR disabling mask Signed-off-by: Yedidya Benshimol Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 8252b24b5aca..5c17120dcc2a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -33,6 +33,19 @@ static const char *iwl_get_esr_state_string(enum iwl_mvm_esr_state state) return iwl_mvm_esr_states_names[offs]; } +static void iwl_mvm_print_esr_state(struct iwl_mvm *mvm, u32 mask) +{ +#define NAME_FMT(x) "%s" +#define NAME_PR(x) (mask & IWL_MVM_ESR_##x) ? "[" #x "]" : "", + IWL_DEBUG_INFO(mvm, + "EMLSR state = " HANDLE_ESR_REASONS(NAME_FMT) + " (0x%x)\n", + HANDLE_ESR_REASONS(NAME_PR) + mask); +#undef NAME_FMT +#undef NAME_PR +} + static u32 iwl_mvm_get_free_fw_link_id(struct iwl_mvm *mvm, struct iwl_mvm_vif *mvm_vif) { @@ -708,16 +721,12 @@ iwl_mvm_esr_disallowed_with_link(struct ieee80211_vif *vif, if (conf->csa_active) ret |= IWL_MVM_ESR_EXIT_CSA; -#define NAME_FMT(x) "%s" -#define NAME_PR(x) (ret & IWL_MVM_ESR_##x) ? "[" #x "]" : "", - - if (ret) + if (ret) { IWL_DEBUG_INFO(mvm, - "Link %d is not allowed for esr. reason = " - HANDLE_ESR_REASONS(NAME_FMT) " (0x%x)\n", - link->link_id, - HANDLE_ESR_REASONS(NAME_PR) - ret); + "Link %d is not allowed for esr\n", + link->link_id); + iwl_mvm_print_esr_state(mvm, ret); + } return ret; } @@ -1016,10 +1025,12 @@ void iwl_mvm_block_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (WARN_ON(!(reason & IWL_MVM_BLOCK_ESR_REASONS))) return; - if (!(mvmvif->esr_disable_reason & reason)) + if (!(mvmvif->esr_disable_reason & reason)) { IWL_DEBUG_INFO(mvm, "Blocking EMLSR mode. reason = %s (0x%x)\n", iwl_get_esr_state_string(reason), reason); + iwl_mvm_print_esr_state(mvm, mvmvif->esr_disable_reason); + } mvmvif->esr_disable_reason |= reason; @@ -1107,11 +1118,12 @@ void iwl_mvm_unblock_esr(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (!(mvmvif->esr_disable_reason & reason)) return; + mvmvif->esr_disable_reason &= ~reason; + IWL_DEBUG_INFO(mvm, "Unblocking EMLSR mode. reason = %s (0x%x)\n", iwl_get_esr_state_string(reason), reason); - - mvmvif->esr_disable_reason &= ~reason; + iwl_mvm_print_esr_state(mvm, mvmvif->esr_disable_reason); if (!mvmvif->esr_disable_reason) iwl_mvm_esr_unblocked(mvm, vif); From patchwork Mon May 6 07:04:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795182 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 C59FB5464A for ; Mon, 6 May 2024 07:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979089; cv=none; b=DsKpzxxYWfhBpg6Ar3IXUXyeVrGUPG8KDMniOaA41Tweul0zyY0Wp02TLZjr2WaxVxpTjPx0mKFy9hcc+C0dXGGQY/kXhfQpxHtbJ7X6+w2QmcIKSYkdmuwoSQdywlYjPCdl6RoDz7eVt0XoxBFE+EtTjCqGEnyS1Yrr5fHPHIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979089; c=relaxed/simple; bh=4C+NKqjDDkmy+8QLLd67L+s0Nt8cHMl1dUa8gu2WtSM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Lze5dOtP20ZzxypstI54eEkimQZHVZlQrDi4AHfHX8XRCNPpGQfNpXNhGb1woL4sHxh5X6IJhTfQE+/8UHohNd1PEjxh1o+enh4CII/dsbvi6aR2DY9sobS8i9OPsWEwnx7FhJV2eGnYmXxk9yzr+DtQN3+9XLIuebabA1Dmrd4= 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=EUwtPTQi; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EUwtPTQi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979088; x=1746515088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4C+NKqjDDkmy+8QLLd67L+s0Nt8cHMl1dUa8gu2WtSM=; b=EUwtPTQiUGJRHQDB+EB7jfA8+2FrVkEf5ZrN+w0DHE76hth0Hl7g4RKO Wm3DZ+pNMcigxtptbDZTIAAn8aMkbVNwOISjPH+Z6OzxKVf6HPF3VOZlc vtHf8n66aza6yjTqV8Oyz5D3y0HSY5x9D4hh0IkW2qkZ04NuyS+csWN9P 3cOki9suvcy8ey0JiQ8tmc7Ket7UG05hZbN930GqVabhXYO7XzaCYfOJt fZn2eXnWlDrN92SQ8GrmutD/pxKrRKG37SAbODJGf9LqcEk9QMXT4U4F+ pEOMZ3yHUY2Rf9aIG/kxG4Alg41eOJy58+mZvfuQsZRTquiOSC7/Rr1H3 w==; X-CSE-ConnectionGUID: TdWxGZwoSEywOxhK8mEqyA== X-CSE-MsgGUID: aZsj8N8qTUGzzK4veNdUpQ== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638195" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638195" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:40 -0700 X-CSE-ConnectionGUID: v5L9qm6wSiKSALPDeSb5jQ== X-CSE-MsgGUID: hFENejD6TeW4yy5fwcenlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264919" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:38 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Yedidya Benshimol Subject: [PATCH 06/15] wifi: iwlwifi: mvm: Add a print for invalid link pair due to bandwidth Date: Mon, 6 May 2024 10:04:10 +0300 Message-Id: <20240506095953.9e57ad898cf4.Id8edfd5e3774ea6475d5f4178ab7ea75a870ef95@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 From: Yedidya Benshimol When validating a link pair for EMLSR, add a print for invalid link pair due to bandwidth Signed-off-by: Yedidya Benshimol Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 21b5cc0413fe..b0568c74a15b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -691,12 +691,11 @@ s8 iwl_mvm_get_esr_rssi_thresh(struct iwl_mvm *mvm, } static u32 -iwl_mvm_esr_disallowed_with_link(struct ieee80211_vif *vif, +iwl_mvm_esr_disallowed_with_link(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, const struct iwl_mvm_link_sel_data *link, bool primary) { - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - struct iwl_mvm *mvm = mvmvif->mvm; struct wiphy *wiphy = mvm->hw->wiphy; struct ieee80211_bss_conf *conf; enum iwl_mvm_esr_state ret = 0; @@ -735,20 +734,30 @@ bool iwl_mvm_mld_valid_link_pair(struct ieee80211_vif *vif, const struct iwl_mvm_link_sel_data *a, const struct iwl_mvm_link_sel_data *b) { - /* Per-link considerations */ - if (iwl_mvm_esr_disallowed_with_link(vif, a, true) || - iwl_mvm_esr_disallowed_with_link(vif, b, false)) - return false; + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); + struct iwl_mvm *mvm = mvmvif->mvm; + enum iwl_mvm_esr_state ret = 0; - if (a->chandef->width != b->chandef->width) + /* Per-link considerations */ + if (iwl_mvm_esr_disallowed_with_link(mvm, vif, a, true) || + iwl_mvm_esr_disallowed_with_link(mvm, vif, b, false)) return false; - if (!(a->chandef->chan->band == NL80211_BAND_6GHZ && + if (a->chandef->width != b->chandef->width || + !(a->chandef->chan->band == NL80211_BAND_6GHZ && b->chandef->chan->band == NL80211_BAND_5GHZ)) + ret |= IWL_MVM_ESR_EXIT_BANDWIDTH; + + if (ret) { + IWL_DEBUG_INFO(mvm, + "Links %d and %d are not a valid pair for EMLSR\n", + a->link_id, b->link_id); + iwl_mvm_print_esr_state(mvm, ret); return false; + } + + return true; - /* Per-combination considerations */ - return a->chandef->chan->band != b->chandef->chan->band; } EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mvm_mld_valid_link_pair); From patchwork Mon May 6 07:04:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795181 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 B573250263 for ; Mon, 6 May 2024 07:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979097; cv=none; b=UGkJJTXyFR8MSIVolYNqLOf8WeYJFfT1L6GhjOqj8YGoCWglo2dIC/XciEArBwYInIfr2WtMFEMex3sfnFprLHGuMW435+FS7qpnd6aBPPAzxpBnECL2YCnRKQrjQmHHLt6xno0bT/NjiTR1n2rmRGzZ3E0u1hZc5ek9tJocflQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979097; c=relaxed/simple; bh=MUQSYQ+lgbOX9qrW52+esnLzPIqOBRUE+0QDq/uu/38=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rQlpmhawE2gnADwHDzDFq1LFk8n700rOP/Xs6V04Z6aTLHa9uiaH2UveR1jWmtScGi29qByebFgJpoDu0JMS6nunlK5zdy6JBYgntOLKtgK1RudRYs4DD4Lf7aqzzcl0i2b3V3q3OCi1VECVOD8Sh7LH6Q0Ftoc8oLHrZtCRyow= 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=iDUfPf1l; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iDUfPf1l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979096; x=1746515096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MUQSYQ+lgbOX9qrW52+esnLzPIqOBRUE+0QDq/uu/38=; b=iDUfPf1lH/02t23xbTmJCCSoQZgZs3WeGsZ78asb3NcpmKwJXHU1j5nB +JgA7NJIyEtllawhhs+OL9Wx6b1S2ACFTv30dwtFl5Edw5o0h/Kty/9D2 vlqmSRAsDVpyBfBW3DhWttRp0XI7qYpLb7jlPVtsDLJZUjxl5xNkDqCDg AUG5z0kUuFuQIn2KOhC8J7ElN6iUEqs/CPvsjk0E2+0rexanhBfqgD44H euTzGUbrwBYvHY2mrlW0WFa7V9w7h6/jnKjz4B87OzPIpj6LkE9tMZAx0 lUKCvjnaV1to8pKAaoSlqixO4RyCjQKRnC8wSfsmVWlCltRWmy3H1+J/F A==; X-CSE-ConnectionGUID: Qx6viz+RSCC6VbLTa3KscQ== X-CSE-MsgGUID: sIBSejUKSnqaF67G67MwhA== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638221" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638221" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:44 -0700 X-CSE-ConnectionGUID: /3oDjQb8Rp+BXAXlKT1G1g== X-CSE-MsgGUID: QqPNvHXyQ5KZ/y+5yw29oQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264931" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:42 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg Subject: [PATCH 08/15] wifi: iwlwifi: mvm: add the firmware API for channel survey Date: Mon, 6 May 2024 10:04:12 +0300 Message-Id: <20240506095953.1facde532676.I3864ac4bc0fecb7fd5136e85c07585ab7100234b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 From: Benjamin Berg When requested, the firmware can return per-channel survey information generally used for ACS (automatic channel selection). Add the API for this, which consists of a flag and a new channel survey notification. Signed-off-by: Benjamin Berg Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/fw/api/scan.h | 33 ++++++++++++++++++- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h index 93078f8cc08c..6684506f4fc4 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* - * Copyright (C) 2012-2014, 2018-2023 Intel Corporation + * Copyright (C) 2012-2014, 2018-2024 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */ @@ -13,6 +13,10 @@ * enum iwl_scan_subcmd_ids - scan commands */ enum iwl_scan_subcmd_ids { + /** + * @CHANNEL_SURVEY_NOTIF: &struct iwl_umac_scan_channel_survey_notif + */ + CHANNEL_SURVEY_NOTIF = 0xFB, /** * @OFFLOAD_MATCH_INFO_NOTIF: &struct iwl_scan_offload_match_info */ @@ -62,6 +66,8 @@ struct iwl_ssid_ie { #define IWL_FAST_SCHED_SCAN_ITERATIONS 3 #define IWL_MAX_SCHED_SCAN_PLANS 2 +#define IWL_MAX_NUM_NOISE_RESULTS 22 + enum scan_framework_client { SCAN_CLIENT_SCHED_SCAN = BIT(0), SCAN_CLIENT_NETDETECT = BIT(1), @@ -642,10 +648,13 @@ enum iwl_umac_scan_general_flags { * notification per channel or not. * @IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER: Whether to allow channel * reorder optimization or not. + * @IWL_UMAC_SCAN_GEN_FLAGS2_COLLECT_CHANNEL_STATS: Enable channel statistics + * collection when #IWL_UMAC_SCAN_GEN_FLAGS_V2_FORCE_PASSIVE is set. */ enum iwl_umac_scan_general_flags2 { IWL_UMAC_SCAN_GEN_FLAGS2_NOTIF_PER_CHNL = BIT(0), IWL_UMAC_SCAN_GEN_FLAGS2_ALLOW_CHNL_REORDER = BIT(1), + IWL_UMAC_SCAN_GEN_FLAGS2_COLLECT_CHANNEL_STATS = BIT(3), }; /** @@ -1258,4 +1267,26 @@ struct iwl_umac_scan_iter_complete_notif { struct iwl_scan_results_notif results[]; } __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_2 */ +/** + * struct iwl_umac_scan_channel_survey_notif - data for survey + * @channel: the channel scanned + * @band: band of channel + * @noise: noise floor measurements in negative dBm, invalid 0xff + * @reserved: for future use and alignment + * @active_time: time in ms the radio was turned on (on the channel) + * @busy_time: time in ms the channel was sensed busy, 0 for a clean channel + * @tx_time: time the radio spent transmitting data + * @rx_time: time the radio spent receiving data + */ +struct iwl_umac_scan_channel_survey_notif { + __le32 channel; + __le32 band; + u8 noise[IWL_MAX_NUM_NOISE_RESULTS]; + u8 reserved[2]; + __le32 active_time; + __le32 busy_time; + __le32 tx_time; + __le32 rx_time; +} __packed; /* SCAN_CHANNEL_SURVEY_NTF_API_S_VER_1 */ + #endif /* __iwl_fw_api_scan_h__ */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index b27a03207938..c52e69743c80 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -651,6 +651,7 @@ static const struct iwl_hcmd_names iwl_mvm_statistics_names[] = { * Access is done through binary search */ static const struct iwl_hcmd_names iwl_mvm_scan_names[] = { + HCMD_NAME(CHANNEL_SURVEY_NOTIF), HCMD_NAME(OFFLOAD_MATCH_INFO_NOTIF), }; From patchwork Mon May 6 07:04:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795180 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 D996F6D1A3 for ; Mon, 6 May 2024 07:05:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979104; cv=none; b=r5gTuDT5SwzOOIWqFm65iLAh8qnMgLY/9jwtPCxY6Ub1mS6SILqAnoKPYjoJvPcBkwfwkuSEu9qO03wHNwYSwyWaXSO9Xwx4LEGrqQfT41PYAM4/dQUFCmIm+SkWiFUg0Wt739xrcq7HWqM/S3INYxeEQc5ElNyVzGTMu8Zm164= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979104; c=relaxed/simple; bh=vW38m0CmhK5Ur94Y5pn5dk44eDscKzA8VDcCYQCYfJQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Bs/rCw4iXfkw8KeehO/8kssh2Cgp7PvDyJhQOSVa4kyQtJPUlqF7I8qPOvQej1Pc/N3QMm9Gta8m5bv9WDTfIq/MiCRt5eLHTKp4lEw6GtfHgXcGgDt3ZyWG4X0EnZxkQrA0Qb7Pgrfi/X597BA10IrooY/6jsZ3mKQT5dVc+mw= 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=GOLq6Zgu; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GOLq6Zgu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979103; x=1746515103; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vW38m0CmhK5Ur94Y5pn5dk44eDscKzA8VDcCYQCYfJQ=; b=GOLq6ZgufLVJFxal+RUP0dqPPUNW8GYGCmq7dRZB2386/jlnU7GAkkkQ potHWxYzkANRvVcSuvXv1xgGZhu+QwwxE6R+P0P02dzLc79fMGclL6vdE lEMPTQU2J5P1UwdLNhBMB1Dogapx4DVXHmOb+H66ZPeQUS0cE1AC6OI5E zYQvKKb9iHqNWMfnDFJKClm2bvhwxmpQHOnXYlBcrVeXv/9tcGE+4kJaO rfBvA//cdVX+T5W/mopbDKsVLf9F12dcMCmYIi3kz34vk0O9j1+ShPyid OsAP+xKH0oPz7rD5ABX56KgT0S2eyP/9YZ+WSUfL0EYnTo5PoPN2GbCuQ Q==; X-CSE-ConnectionGUID: iPcC79E/SmiNVw4x8Z35nQ== X-CSE-MsgGUID: 5MjeDORXTtqlSBY5pBg9ZQ== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638234" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638234" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:47 -0700 X-CSE-ConnectionGUID: lm+8EON1SPWzgJBgwrr3Kw== X-CSE-MsgGUID: RSwR3WdATvKK+xc8dmuzjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264943" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:45 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Ofer Kimelman Subject: [PATCH 10/15] wifi: iwlwifi: Force SCU_ACTIVE for specific platforms Date: Mon, 6 May 2024 10:04:14 +0300 Message-Id: <20240506095953.3d0c56c2bb1a.I97d9da402890d2085b5698666cceffc417b6b6df@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 From: Daniel Gabay Firmware 0x2F7 assert observed in Dell platforms when using GL HW. This issue is mitigated by setting SCU_FORCE_ACTIVE during platform low power states. Driver shall indicate firmware to force SCU active by setting bit 29 in context info prph scratch control flags. This mitigation is limited to Dell platforms with GL HW only. Signed-off-by: Daniel Gabay Reviewed-by: Ofer Kimelman Signed-off-by: Miri Korenblit --- .../intel/iwlwifi/iwl-context-info-gen3.h | 5 ++- .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 31 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h b/drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h index 1379dc2d231b..5b62933134cf 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-context-info-gen3.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* - * Copyright (C) 2018, 2020-2023 Intel Corporation + * Copyright (C) 2018, 2020-2024 Intel Corporation */ #ifndef __iwl_context_info_file_gen3_h__ #define __iwl_context_info_file_gen3_h__ @@ -56,6 +56,8 @@ enum iwl_prph_scratch_mtr_format { * @IWL_PRPH_SCRATCH_RB_SIZE_EXT_8K: 8kB RB size * @IWL_PRPH_SCRATCH_RB_SIZE_EXT_12K: 12kB RB size * @IWL_PRPH_SCRATCH_RB_SIZE_EXT_16K: 16kB RB size + * @IWL_PRPH_SCRATCH_SCU_FORCE_ACTIVE: Indicate fw to set SCU_FORCE_ACTIVE + * upon reset. */ enum iwl_prph_scratch_flags { IWL_PRPH_SCRATCH_IMR_DEBUG_EN = BIT(1), @@ -71,6 +73,7 @@ enum iwl_prph_scratch_flags { IWL_PRPH_SCRATCH_RB_SIZE_EXT_8K = 8 << 20, IWL_PRPH_SCRATCH_RB_SIZE_EXT_12K = 9 << 20, IWL_PRPH_SCRATCH_RB_SIZE_EXT_16K = 10 << 20, + IWL_PRPH_SCRATCH_SCU_FORCE_ACTIVE = BIT(29), }; /* diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c index c8fc8b4fd85c..ebf11f276b20 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c @@ -1,13 +1,34 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ +#include #include "iwl-trans.h" #include "iwl-fh.h" #include "iwl-context-info-gen3.h" #include "internal.h" #include "iwl-prph.h" +static const struct dmi_system_id dmi_force_scu_active_approved_list[] = { + { .ident = "DELL", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + }, + }, + { .ident = "DELL", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), + }, + }, + /* keep last */ + {} +}; + +static bool iwl_is_force_scu_active_approved(void) +{ + return !!dmi_check_system(dmi_force_scu_active_approved_list); +} + static void iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, struct iwl_prph_scratch_hwm_cfg *dbg_cfg, @@ -128,6 +149,14 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, if (trans->trans_cfg->imr_enabled) control_flags |= IWL_PRPH_SCRATCH_IMR_DEBUG_EN; + if (CSR_HW_REV_TYPE(trans->hw_rev) == IWL_CFG_MAC_TYPE_GL && + iwl_is_force_scu_active_approved()) { + control_flags |= IWL_PRPH_SCRATCH_SCU_FORCE_ACTIVE; + IWL_DEBUG_FW(trans, + "Context Info: Set SCU_FORCE_ACTIVE (0x%x) in control_flags\n", + IWL_PRPH_SCRATCH_SCU_FORCE_ACTIVE); + } + /* initialize RX default queue */ prph_sc_ctrl->rbd_cfg.free_rbd_addr = cpu_to_le64(trans_pcie->rxq->bd_dma); From patchwork Mon May 6 07:04:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795179 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 2FD847D06E for ; Mon, 6 May 2024 07:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979105; cv=none; b=BCt1JNS+UGS4mJfUD+iJZ6tpM9SgqE8bW6GsX94SR8NqBfERUZY2at+t50YmA2dXf0LmHAeS5ZNkQgonJvkg4ndYyfPWzRxjDbPoXvmmv9A4tniME5RzyzBPecZ4q+YbKshjncRxC8CyNtqR5a3ZEMMrVSzs9ZI8vDbrneQfQ0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979105; c=relaxed/simple; bh=ugG6CR6kXKPeohpjZd46oi+5QmHPp68lpjv2CKY87Os=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=av51ih9PbOXY6sm1go6r+d6GyHJ9xUTXv1OKvbwm2KzvE8l4VsrGmWE+SRNmOqxFGgDlPUe+Z/48uvP5ORwbw4Wj7xLtMOAF0s6Y9al/LM0QIyQnq80Sj933+faIL/NJgv1y0CO3IbGn83oO+ifHDfynLk4aERFy/69rU/q4jlo= 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=ZdbDsCHA; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZdbDsCHA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979105; x=1746515105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ugG6CR6kXKPeohpjZd46oi+5QmHPp68lpjv2CKY87Os=; b=ZdbDsCHAusP42+EJ6FuHSGkcjKM+GklZ8GrQ1++c/1hwkkthK0SmdBZ3 NHZRda9ufCdtvBsnlPbQqJ6K4YtMvnsnJGaTBu/Y2hqQN9+Rfk20AmeRY gtlZIlT/4AodsNln89z0swB3jrHA1IkqMqXXdSK5TEzW8Ff9Iuyewtksc jloFy2enLUmDfdFApJfmoyXTzD9YRGuH1BQBypaFp/3BjW/wxxz/PnS1j T5h5jVyz3p0//vhQPTUpXdSP0cXroZxym1uCqSmSU57r2QhxzKy+NVCQo I/ph99DlCO4bVCWoY3gInNajZZQls9fUnbyHU8e+5fZ7vhc6zFUofNOzv Q==; X-CSE-ConnectionGUID: VWMGHNeJQOSaenQWkH6ZwQ== X-CSE-MsgGUID: jtI65bg4Q2uevUMcgfLN6Q== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638255" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638255" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:51 -0700 X-CSE-ConnectionGUID: ztRjRzwiQC2+Rdg8XPM2fA== X-CSE-MsgGUID: my3XMPq3SU2UTYhY1y9RHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59264998" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:49 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 13/15] wifi: iwlwifi: mvm: exit EMLSR if secondary link is not used Date: Mon, 6 May 2024 10:04:17 +0300 Message-Id: <20240506095953.99ad1d71e9b9.Ide825433488ec809773efdc36937e3089d0012df@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 Exit EMLSR mode if the secondary link is not used enough for Rx/Tx Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 3 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 37 ++++++++++++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index b0568c74a15b..b4ba5f81f20c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -15,7 +15,8 @@ HOW(EXIT_LOW_RSSI) \ HOW(EXIT_COEX) \ HOW(EXIT_BANDWIDTH) \ - HOW(EXIT_CSA) + HOW(EXIT_CSA) \ + HOW(EXIT_LINK_USAGE) static const char *const iwl_mvm_esr_states_names[] = { #define NAME_ENTRY(x) [ilog2(IWL_MVM_ESR_##x)] = #x, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index b96568f5640c..1f58c727fa63 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -369,6 +369,7 @@ struct iwl_mvm_vif_link_info { * @IWL_MVM_ESR_EXIT_BANDWIDTH: Bandwidths of primary and secondry links * preventing the enablement of EMLSR * @IWL_MVM_ESR_EXIT_CSA: CSA happened, so exit EMLSR + * @IWL_MVM_ESR_EXIT_LINK_USAGE: Exit EMLSR due to low tpt on secondary link */ enum iwl_mvm_esr_state { IWL_MVM_ESR_BLOCKED_PREVENTION = 0x1, @@ -381,6 +382,7 @@ enum iwl_mvm_esr_state { IWL_MVM_ESR_EXIT_COEX = 0x40000, IWL_MVM_ESR_EXIT_BANDWIDTH = 0x80000, IWL_MVM_ESR_EXIT_CSA = 0x100000, + IWL_MVM_ESR_EXIT_LINK_USAGE = 0x200000, }; #define IWL_MVM_BLOCK_ESR_REASONS 0xffff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index 36083905457b..4fa8066a89b6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -951,12 +951,19 @@ iwl_mvm_stat_iterator_all_links(struct iwl_mvm *mvm, } } +#define SEC_LINK_MIN_PERC 10 +#define SEC_LINK_MIN_TX 3000 +#define SEC_LINK_MIN_RX 400 + static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) { struct ieee80211_vif *bss_vif = iwl_mvm_get_bss_vif(mvm); struct iwl_mvm_vif *mvmvif; struct iwl_mvm_sta *mvmsta; unsigned long total_tx = 0, total_rx = 0; + unsigned long sec_link_tx = 0, sec_link_rx = 0; + u8 sec_link_tx_perc, sec_link_rx_perc; + u8 sec_link; lockdep_assert_held(&mvm->mutex); @@ -973,6 +980,13 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) if (!mvmsta->mpdu_counters) return; + /* Get the FW ID of the secondary link */ + sec_link = iwl_mvm_get_other_link(bss_vif, + iwl_mvm_get_primary_link(bss_vif)); + if (WARN_ON(!mvmvif->link[sec_link])) + return; + sec_link = mvmvif->link[sec_link]->fw_link_id; + /* Sum up RX and TX MPDUs from the different queues/links */ for (int q = 0; q < mvm->trans->num_rx_queues; q++) { spin_lock_bh(&mvmsta->mpdu_counters[q].lock); @@ -982,6 +996,10 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) total_tx += mvmsta->mpdu_counters[q].per_link[link].tx; total_rx += mvmsta->mpdu_counters[q].per_link[link].rx; } + + sec_link_tx += mvmsta->mpdu_counters[q].per_link[sec_link].tx; + sec_link_rx += mvmsta->mpdu_counters[q].per_link[sec_link].rx; + /* * In EMLSR we have statistics every 5 seconds, so we can reset * the counters upon every statistics notification. @@ -994,9 +1012,26 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) /* If we don't have enough MPDUs - exit EMLSR */ if (total_tx < IWL_MVM_ENTER_ESR_TPT_THRESH && - total_rx < IWL_MVM_ENTER_ESR_TPT_THRESH) + total_rx < IWL_MVM_ENTER_ESR_TPT_THRESH) { iwl_mvm_block_esr(mvm, bss_vif, IWL_MVM_ESR_BLOCKED_TPT, iwl_mvm_get_primary_link(bss_vif)); + return; + } + + /* Calculate the percentage of the secondary link TX/RX */ + sec_link_tx_perc = total_tx ? sec_link_tx * 100 / total_tx : 0; + sec_link_rx_perc = total_rx ? sec_link_rx * 100 / total_rx : 0; + + /* + * The TX/RX percentage is checked only if it exceeds the required + * minimum. In addition, RX is checked only if the TX check failed. + */ + if ((total_tx > SEC_LINK_MIN_TX && + sec_link_tx_perc < SEC_LINK_MIN_PERC) || + (total_rx > SEC_LINK_MIN_RX && + sec_link_rx_perc < SEC_LINK_MIN_PERC)) + iwl_mvm_exit_esr(mvm, bss_vif, IWL_MVM_ESR_EXIT_LINK_USAGE, + iwl_mvm_get_primary_link(bss_vif)); } void iwl_mvm_handle_rx_system_oper_stats(struct iwl_mvm *mvm, From patchwork Mon May 6 07:04:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 795178 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 B2E2F140370 for ; Mon, 6 May 2024 07:05:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979106; cv=none; b=t6VsoPiPXnytnspusW6umUdehKvCKUl/ZQFA+IEDNW5O+2Qw+/iAR5EFvuXTNLCD2G93ZO7Z2lLOz7vKh6o2ctuIfnTigechr+30FsRkAvIA6FBqIuybbjWs4Ww8hGL3fdMCYd70LNGLU271ubudSORBYjZw01ClMXt2N4fwwI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714979106; c=relaxed/simple; bh=Wk9y+J+sqxjHcaiMv9mqpmeWgO4t83WZipC7Zie8W6s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FdB8zOUSZxDp4cgZMEpFeq2zJcrl84jYSRXU/Il3QKK8qAnJoQgjN0lreOGndnzRzb2uIGcGujQn7nMWK6tIV9QT6Tc2pfx1EkTVXRQ+C1TDooDekUZAkM1m3axdKL7dvGReTpUewHpHwX6Qh01PqW0E88lQLybQkhpvp7+Fjbk= 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=acA9Ygrd; arc=none smtp.client-ip=198.175.65.21 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="acA9Ygrd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714979105; x=1746515105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Wk9y+J+sqxjHcaiMv9mqpmeWgO4t83WZipC7Zie8W6s=; b=acA9YgrdXhBWfKxCc1KMjuJq+BXRzNH5V0+IoP/w+rHolYGWfmMm/s66 zAnnXBhk9xT8iiH55RpevYVV6dt9Rrhvgnp7dJVaLCz2PRjN3s1jcjV7D 7ByYrhBu1fyjIQRaplMd3NRfvRorfL2++3KNvrYwmR5bOCnvRa/vHaD8C CCaMJZV2vnHJ+ZOumfdmhEzxRK68XUmmp1AmoIzINkbSLGN3EeqVyPsdq wg2PE7Cg7mRXSjbdfZDvNvYWR4PUQ80OtD1WmpPgsfgfWTExCtCP61QQ7 FAMTlUGqlpIGoPEj1X18lrDRM6kI8XYf6ZIJmLJDq+ZhV44RQisofdxJu g==; X-CSE-ConnectionGUID: YU1fe8F2TgmkLzWWWz8sXg== X-CSE-MsgGUID: lIvntxz9RrOwInJADrSggQ== X-IronPort-AV: E=McAfee;i="6600,9927,11064"; a="10638261" X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="10638261" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:52 -0700 X-CSE-ConnectionGUID: EebA4DnRQ+OaYmgGzjus4A== X-CSE-MsgGUID: nGBknR/PSTCJ/kjZikhlIw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,257,1708416000"; d="scan'208";a="59265007" Received: from weis0040.iil.intel.com ([10.12.217.108]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2024 00:04:51 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 14/15] wifi: iwlwifi: mvm: don't request statistics in restart Date: Mon, 6 May 2024 10:04:18 +0300 Message-Id: <20240506095953.16638dec9f7b.I093514312179bae566ad8d73ffb0355c6eee288a@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506070419.1821330-1-miriam.rachel.korenblit@intel.com> References: <20240506070419.1821330-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 During restart mac80211 notifies the driver about the association, (if we was associated before the restart) which causes the driver to request statistics from the FW. This causes to an immediate exit from EMLSR after the restart is done, when the statistics notif is handled. (too low TPT). There is no point in requesting statistics wnyway, since the FW just started and don't have any. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index 74452b2112b0..47283a358ffd 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c @@ -435,6 +435,13 @@ int iwl_mvm_request_statistics(struct iwl_mvm *mvm, bool clear) IWL_FW_CMD_VER_UNKNOWN); int ret; + /* + * Don't request statistics during restart, they'll not have any useful + * information right after restart, nor is clearing needed + */ + if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) + return 0; + if (cmd_ver != IWL_FW_CMD_VER_UNKNOWN) return iwl_mvm_request_system_statistics(mvm, clear, cmd_ver);