Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1978184lqp; Tue, 16 Apr 2024 03:55:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhuxkOImW0V6j3+oXPSl1bDonNfg2jTztEOx8VDpSxB65UmOGm2sN8E/3QkNEbD0v4Z8UPm9FIndMTyb+eHOFFX4+OzVkCqYR08QBxOw== X-Google-Smtp-Source: AGHT+IHw9xxjdKP1HE4YvIpK6IoGu+ev15MpUD4JBc6sTNbnXGf87u0pep8S5qct8HrUGn7D13Pl X-Received: by 2002:a05:622a:1352:b0:436:a4fb:2d4f with SMTP id w18-20020a05622a135200b00436a4fb2d4fmr13511163qtk.59.1713264946913; Tue, 16 Apr 2024 03:55:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713264946; cv=pass; d=google.com; s=arc-20160816; b=WrPHsA9s7kqbesS7F6mEKrwsN7bzQyGeA3hZx1+fobqFiRJWRHuyEh8Wo3uloUVtIL vOfIaLULBZNvI5MT/JO8BjbXf5K9JwXbccWMrZbGQHxl9AyvzYZ7jgH2pN33r0jsHT7Y pgy+C0ZnhUGqx42cy5VYH0U8l5x16YqGjK7Xnxeudv/+g6z0g5XQ4OQbs55WzX6wkMUX j7pTrSPvcVJ6/w7MXBMFX3SOToNCvqEAZz3bsJwy4CkaOoV5bbeuU2CI6lBh3gsZoq9+ AzrrBjDOw21qDHcpASEJiiycA4Ag9hiVS678ZU8NkG5w8YzkJBsJv3b8Dy66ZrZcKVVl dgig== 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=ghM1Tji1hFn6OhyfL4yu3rS16sHypuBo2j5fC1g8hgo=; fh=KK62kExWtqHTdR3MLeDuCKN/mmttzDYq5rCirUvesjM=; b=pKsUXZYJYDKNEJ0CjiWC+XXgOo6CRGR7XDFFn04FzYnb+tDwzxGSqHfDKmdJph1q3T gZ3M/0V+Z8R4v5lNxFvm3tbWM+PZFn5ZZ3F+90WMbSmEnjLuYxEIuR+yRMAmFHhrO+J+ Umr4Uo6XujOfEGnjlju/+MHKoKVzKE4XoE3l6ZFs+zc0jRZ5qzQCnjLzDDWMYoYRrhHs vOVEfYOJ6efSkZo3Wm+ymJuyWsHb5FPMLYaw5BlPVYm4AByOIB50bdz5v/QTTJu0OQyq IBHm9om+IxDPKKc69a0j3uNVGZkQgzimYyW72goOZJXhIXe32oKM6b2f6yymVCqTSOlJ ALfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jCbw/QRk"; 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-6392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6392-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w18-20020ac87e92000000b0043665a52f59si12799244qtj.48.2024.04.16.03.55.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 03:55:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jCbw/QRk"; 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-6392-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6392-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A0FFA1C20DDE for ; Tue, 16 Apr 2024 10:55:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 256EA1292FC; Tue, 16 Apr 2024 10:54:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jCbw/QRk" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 8A8BC12A17E for ; Tue, 16 Apr 2024 10:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713264891; cv=none; b=GYEbWPBpCDa8yey0OYbzea+3+zTNN6HFq3Qt2RVlucUjbe6omyH8pblB0Ixl82Xn7oov25kcJ0bFtYbRP/cVtQPefUNOpZ637fVzISdijIrRbQau1uBggGo8tAgWpnQjqi55Rr4nGhq8m55TuHBqM/hfKTP34WWSoliop0/BTSM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713264891; c=relaxed/simple; bh=oKpfgOhqoc/XEfQs7e1rxDPU63hb8BypJUHwaryM1U0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mVpJMNI6rFP9+0tTU6EJ3nAuWvqDXMZiyKZB8K8pV32YP+Z+AE4tWEAP3VmWkiRFm1LPMKzfhZCPGyjZyNG93v73SB8kz9Pu2gRW0xf6TfIzuBKTyeRc6eb5HMUDJtpL3+OPH4/du7rYg5ht2S6eTsga9wO83Fn9qC96wdWn134= 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=jCbw/QRk; arc=none smtp.client-ip=192.198.163.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=1713264890; x=1744800890; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oKpfgOhqoc/XEfQs7e1rxDPU63hb8BypJUHwaryM1U0=; b=jCbw/QRkpKmU9h7gkN9HbiH3viZ9RNkS9cc4NVBtCLNXSnZC+GqZtW4p fCQdLqS1/3jAfh5IhChnv0ZG0GS8JVsoUogDOIQU9yTyOfBym/nBsn4+9 yx28+q/PUctfCFlqIiH/llQg2cwfKOtn/tkl4wfS4P4RC6DPA4GaGyuTD wdv/0JkYHWJUEFtQ3XnMfiwhCr+u8npz3T9ixkGt5+stm9qzt9h6xQU+x F2rH7t0S56gLPudoFr/abtqN61GhXi4yZqDpzlenP4SLqZL1hasak5w9n 5/1OLBZQ0zjACMFGaWdh5Gn8FqE3pYWPLSRArcuemfT6VoT0dLyLhvTJr w==; X-CSE-ConnectionGUID: OAjf7EMgSma4Z8x41fd8RA== X-CSE-MsgGUID: hBsYAvfkRwi4TBrq9vwZCA== X-IronPort-AV: E=McAfee;i="6600,9927,11045"; a="8556077" X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="8556077" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 03:54:49 -0700 X-CSE-ConnectionGUID: TQ2oosTcTQOJODoDslrAWw== X-CSE-MsgGUID: IcN/8iqwTmqFQIl2lrlnKg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,205,1708416000"; d="scan'208";a="26872595" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2024 03:54:48 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Yedidya Benshimol Subject: [PATCH 15/16] wifi: iwlwifi: mvm: disable EMLSR when we suspend with wowlan Date: Tue, 16 Apr 2024 13:54:10 +0300 Message-Id: <20240416134215.6ea884b3f095.I84233cb1c79ba538defafb8ddb983c47f04a400a@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416105411.706221-1-miriam.rachel.korenblit@intel.com> References: <20240416105411.706221-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: Yedidya Benshimol We can't be an EMLSR while suspended with wowlan. De-activate the secondary link upon wowlan entring. Set the blocking reason upon suspension and clear it upon resume. Signed-off-by: Yedidya Benshimol Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 19 +++++++++---------- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 6763863f4354..778ea64f3f28 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -1261,22 +1261,19 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, if (IS_ERR_OR_NULL(vif)) return 1; - mutex_lock(&mvm->mutex); - primary_link = iwl_mvm_get_primary_link(vif); - if (ieee80211_vif_is_mld(vif) && vif->cfg.assoc && - mvmvif->esr_active) { - /* - * Select the 'best' link. May need to revisit, it seems - * better to not optimize for throughput but rather - * range, reliability and power here - and select - * 2.4 GHz ... - */ + + /* leave ESR immediately, not only async with iwl_mvm_block_esr() */ + if (ieee80211_vif_is_mld(vif)) { ret = ieee80211_set_active_links(vif, BIT(primary_link)); if (ret) return ret; } + mutex_lock(&mvm->mutex); + /* only additionally block for consistency and to avoid concurrency */ + iwl_mvm_block_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_WOWLAN, primary_link); + set_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); synchronize_net(); @@ -3463,6 +3460,8 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) goto err; } + iwl_mvm_unblock_esr(mvm, vif, IWL_MVM_ESR_BLOCKED_WOWLAN); + /* after the successful handshake, we're out of D3 */ mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 9f343d015d81..1171fc831ca8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -678,7 +678,9 @@ u8 iwl_mvm_get_primary_link(struct ieee80211_vif *vif) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - lockdep_assert_held(&mvmvif->mvm->mutex); + /* relevant data is written with both locks held, so read with either */ + lockdep_assert(lockdep_is_held(&mvmvif->mvm->mutex) || + lockdep_is_held(&mvmvif->mvm->hw->wiphy->mtx)); if (!ieee80211_vif_is_mld(vif)) return 0; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 050a04c185e5..2ef346c54d24 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -356,11 +356,13 @@ struct iwl_mvm_vif_link_info { * @IWL_MVM_ESR_BLOCKED_COEX: COEX is preventing the enablement of EMLSR * @IWL_MVM_ESR_BLOCKED_PREVENTION: Prevent EMLSR to avoid entering and exiting * in a loop. + * @IWL_MVM_ESR_BLOCKED_WOWLAN: WOWLAN is preventing the enablement of EMLSR * @IWL_MVM_ESR_EXIT_MISSED_BEACON: exited EMLSR due to missed beacons */ enum iwl_mvm_esr_state { IWL_MVM_ESR_BLOCKED_COEX = 0x1, IWL_MVM_ESR_BLOCKED_PREVENTION = 0x2, + IWL_MVM_ESR_BLOCKED_WOWLAN = 0x4, IWL_MVM_ESR_EXIT_MISSED_BEACON = 0x10000, }; -- 2.34.1