From patchwork Thu Oct 10 11:04:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829950 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 C3EBB1C231C for ; Thu, 10 Oct 2024 11:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558325; cv=none; b=Mh0yCsMHOwXhETQVjAD5ElKibCNMEx+XGBClDR/SD1cL3UHyPQTJm9gqF4vYC2lNQPh3OyL5yFMbPGlY2ch7JOvzo0B4vzfR9wB8XM68HDFZ0+6HUpBCQrJmpRGOr6lVwrVoIn0MNEz/FDRfCn7mlBOBwC06q9arlbJTMg8sL74= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558325; c=relaxed/simple; bh=QddeRWLzD8HQ5IBiB2I/uU8aSMk3RfqHBRfozV/feb8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PcS6nYFpmhHnD0zeGdzomZauncCm88p7vXCQndhAkDkq0a2FEyKsBPN4EIlyQEOApNWpqPWeYHQZ2K2R+kqanT3PJzLHgx0G+OfqQEUfCeGPZMSuFyEmed3J1wDExVFuUpCmtJUDSfYco19/FR5WZByxog44Qe4cHtX2ny/MAV4= 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=VexkbusC; arc=none smtp.client-ip=198.175.65.14 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="VexkbusC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558323; x=1760094323; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QddeRWLzD8HQ5IBiB2I/uU8aSMk3RfqHBRfozV/feb8=; b=VexkbusCFVxa8FG49xUgwdi7o3zRAgsQ6ErMz0shkxaz3VHI9P5++UIb Y6+9/xJPuzuHdf6AFJZAqzshUoehAJg1pjWEIqGnfBGLx6U4R0PWcYalx rxGGCCeBlAFaep29rXVSJAVNuutQx+ukUTHfnd79QKZBo4gYGb5nP41gY kiK+NmnpF4E0axX0JA4mo1H+CK3zGObdf+eFVdQzGeorAow7PvXtIJQ5z q7OKSevYKvk4NFBO0lx/Ozrc86v3DH2A+kZ7Qslm+FQEXgctruVU3b5Pn xe4NdJgcWV9RwWzVIOMUiHQgGOarRrtoArr/3uvHC1vv3hReTCNjLUktO A==; X-CSE-ConnectionGUID: Iur+lw+9SVuY33Th7u+qww== X-CSE-MsgGUID: 17CNewB1TXKXFoadFe7okQ== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697728" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697728" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:23 -0700 X-CSE-ConnectionGUID: WT9hinVMSq+4CLJ4YkJByA== X-CSE-MsgGUID: xoDeVWLDSXmgop6opirWBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362307" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:22 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 1/9] wifi: iwlwifi: mvm: don't leak a link on AP removal Date: Thu, 10 Oct 2024 14:04:59 +0300 Message-Id: <20241010140328.c54c42779882.Ied79e0d6244dc5a372e8b6ffa8ee9c6e1379ec1d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Emmanuel Grumbach Release the link mapping resource in AP removal. This impacted devices that do not support the MLD API (9260 and down). On those devices, we couldn't start the AP again after the AP has been already started and stopped. Fixes: a8b5d4809b50 ("wifi: iwlwifi: mvm: Configure the link mapping for non-MLD FW") Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index a327893c6dce..39b815904501 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1970,7 +1970,6 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, mvm->p2p_device_vif = NULL; } - iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); iwl_mvm_mac_ctxt_remove(mvm, vif); RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL); @@ -1979,6 +1978,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, mvm->monitor_on = false; out: + iwl_mvm_unset_link_mapping(mvm, vif, &vif->bss_conf); if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) { iwl_mvm_dealloc_int_sta(mvm, &mvmvif->deflink.mcast_sta); From patchwork Thu Oct 10 11:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829951 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 E61261C2428 for ; Thu, 10 Oct 2024 11:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558326; cv=none; b=QP4LJwhusBaHnCjzhjZ0v3PCRsGWyxxGrhzJ3F25TW+i8yHmTRrGwFCc6B9sSqUQ+Px8xBerTTckYTAYh1LOu6AQKkT7CQtznGwblfTEyAgTAIRM7DJLm1iYP8Zj6+MfTqEL22xY5Q951AH3OPrbwTKaLqYyT34Vr0WT1SZcywQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558326; c=relaxed/simple; bh=xOIWEtfCId3yQ8Qxta5NwSgzYE+Rr9i+2UFx7xRR9+k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=owT97kt3eE7ZH6Q8qcMXg4dCx3ANO+gSiUYeRFtbBpeTybwcGzJz0yGVFhnF2IHV1IkDZrNfhcmnO5Xq2U16kF95fdvc/WDZrWDdotI4Xx4mbQmTcrki+Q1g9NdAyOUuF/PazvAbj4GUzYB0wqyHaa17GEoGnoUQn5pSO8BJBvw= 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=BGfi5BfX; arc=none smtp.client-ip=198.175.65.14 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="BGfi5BfX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558325; x=1760094325; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xOIWEtfCId3yQ8Qxta5NwSgzYE+Rr9i+2UFx7xRR9+k=; b=BGfi5BfXUnhacEpVRPLvqyz3SOLyaJ2hL60Y5L6TF9zN9Q3FvfDBLPp6 X+mBi4fDhpg6OQzJBV/fuKBSR/Cu7+PmrbZj9YxakTMpLVHNBZpkw7kgj nh6jsUSQqo5MQfS0+H2aL3Td1wKf5A44834B/crKyAWaldrKZzoTeRWj7 /Ro+zamdFmgw3N6e7XomVN1VmrN9ie+1RSj732CKQXrpN+twY7tJDUZwS /awFp0aEE6S6TUeXtv16lcUhQosVMaR6MjKB07N53A7NCOIps55b4j7ci Ypipj69NQYoFa6RiRVxwZTaDnKMyVqEdDZyuB6YnJUcpYmFROcCo5iPB8 g==; X-CSE-ConnectionGUID: 42D/jRH7QbGeljNM42FH4w== X-CSE-MsgGUID: /sMdW1txRhqOGyC9S9ZBHw== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697731" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697731" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:24 -0700 X-CSE-ConnectionGUID: 97Ya7RnSRKGIsR+35MWKHg== X-CSE-MsgGUID: iHJi0ZarSd24iWXTMHVL7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362312" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:24 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 2/9] wifi: iwlwifi: allow fast resume on ax200 Date: Thu, 10 Oct 2024 14:05:00 +0300 Message-Id: <20241010140328.a60d6303c027.I60061277526302a75cadbba10452e94c54763f13@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Emmanuel Grumbach This feature can be used on ax200 as well. It'll avoid to restart the firmware upon suspend / resume flow. Doing so also avoids releasing and re-allocating all the device related memory which makes the memory's subsystem task easier. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 39b815904501..62d55864b5df 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1369,7 +1369,7 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm, bool suspend) iwl_mvm_rm_aux_sta(mvm); if (suspend && - mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) + mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) iwl_mvm_fast_suspend(mvm); else iwl_mvm_stop_device(mvm); From patchwork Thu Oct 10 11:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829952 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 F3C8E1C2440 for ; Thu, 10 Oct 2024 11:05:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558327; cv=none; b=lUwk9Hqa+NbsO28mjOUMK8SHqycKcPKnje+vi4AYhHyPogogv/ByJC8IyAMKOwMpA+9FuwpJTZm14U1m0iFtf7kHjn2ByYfS1nFzyk1UfL51OCI0WuUnrxeSZoGHruQWD3FXjTdVO9R18e9P8t9sFFp6NvG3BXqcrMAFh+Aob/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558327; c=relaxed/simple; bh=ps94RmKSdbuIVQBNiIeANIEj0is8vWU/iN9oCSwTRTY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZMINgCYpguc0bO6oAN6wY+yPn3eP1XLmhQzMZenx4oBpshaeI80v9p72mI0uw5Xc+ik3nzSvWSCTRk29mBjozdoxGItk6StFh5F83+SuFR+x1pCZnmAz+xiriy0BK2U8lyVrMicQEELGAjV527TxJk4OMLjOc7+2djGmi51Mg6w= 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=S+KDtyq/; arc=none smtp.client-ip=198.175.65.14 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="S+KDtyq/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558326; x=1760094326; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ps94RmKSdbuIVQBNiIeANIEj0is8vWU/iN9oCSwTRTY=; b=S+KDtyq/PIulLvTIEsHNJVKtvaKM/q32BAlme6X0jOuiSWsd1mTxzK3c C1RTQvFjIo0T4xDLcxDFeY791Ie1y/OSGNWR3tsnmxCRquppZJ1egB6uX xRH/jhdJyBZTbRnD9F26o22kQRi79/DI3SwjFOgsxP5RyLYJHH1MFI0Nk 4r6j5q8dryEIGthaFfCCubaTikzYsDPfFyQAtW5lXtTiMHqwqlLGnXGPy 1TQdRUtzMvtlfzZynUOSGkd03mbX8+KikCYov/MoQm3NlCkFeJYPGWTMg xf0UEehFlb68P1lp4lGjupiKVTHsIZngLWW3AswD4Sjc9P5QlozbDh8Kl A==; X-CSE-ConnectionGUID: KRP2OsY4QeeA+m6yPp//vw== X-CSE-MsgGUID: m261vDogQhGN2+1NXPCzsw== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697734" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697734" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:26 -0700 X-CSE-ConnectionGUID: LcW4wbujTuCkNWPgEN6DbQ== X-CSE-MsgGUID: 0MHzHB4rRF2Xix4GC6HO3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362314" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:25 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 3/9] wifi: iwlwifi: mvm: really send iwl_txpower_constraints_cmd Date: Thu, 10 Oct 2024 14:05:01 +0300 Message-Id: <20241010140328.5c235fccd3f1.I2d40dea21e5547eba458565edcb4c354d094d82a@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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 iwl_mvm_send_ap_tx_power_constraint_cmd is a no-op if the link is not active (we need to know the band etc.) However, for the station case it will be called just before we set the link to active (by calling iwl_mvm_link_changed with the LINK_CONTEXT_MODIFY_ACTIVE bit set in the 'changed' flags and active = true), so it will end up doing nothing. Fix this by calling iwl_mvm_send_ap_tx_power_constraint_cmd before iwl_mvm_link_changed. Fixes: 6b82f4e119d1 ("wifi: iwlwifi: mvm: handle TPE advertised by AP") Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index f2378e0fb2fb..bd043db906db 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -350,11 +350,6 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, rcu_read_unlock(); } - if (vif->type == NL80211_IFTYPE_STATION) - iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, - link_conf, - false); - /* then activate */ ret = iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE | @@ -363,6 +358,11 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, if (ret) goto out; + if (vif->type == NL80211_IFTYPE_STATION) + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, + link_conf, + false); + /* * Power state must be updated before quotas, * otherwise fw will complain. From patchwork Thu Oct 10 11:05:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829953 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 0F7D81C2DD4 for ; Thu, 10 Oct 2024 11:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558329; cv=none; b=cJJgbiDfU6gmtIGo6D75P9G7uQH+KpIBLJwdHXMqTxcLflaUp48IF/Q8aSyVqJ86rYuZ1DXuD3CAWvR9aIiHtVGgvZGnpSArwRqDcGhrvcsfnKH/CYVt587+EVKe9b+ecDaTMbjqbhsWzCA+0+e7QdSa/CP7G2MMZ2dQLhpKa0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558329; c=relaxed/simple; bh=QB8rQy4zPTXqDM3JrFzuN/6lCJiG8m07y5ea3Ak/Xo8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qH3N8sXHA/Ig46tFjpesubxvlXX64koydqDunVJjs/hgIhVgNlbShUe0FYScCIP5aISnZvc/DIH9b4LOJSE78JWOTlbZmDbQ+50EgJK0u8stDlS8iqi2TPXptnuJ1508SfeaE6wy6aHTVALB+VpE0tGkztxbQKuk2SVFyYnKkKY= 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=RqCmubHE; arc=none smtp.client-ip=198.175.65.14 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="RqCmubHE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558328; x=1760094328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QB8rQy4zPTXqDM3JrFzuN/6lCJiG8m07y5ea3Ak/Xo8=; b=RqCmubHEXucDB/LAeJWoXh5AsBj/g6cIZVN3acolwijgW4HbFK7eqRKf V9K5sRLiXRWVsYbqObxlwqY/hAsE+xFFHuLFdQrUIZT23fsNHuH+QOS0s jI5+aLdygfGxK4JjTweJWg+Iw0md6yUm1L4kjunfxhLSJZP7IUuRJnma1 Z1xAHt6hq8Qpm6n36lUZ7tCw7N35ihRejv82yR7cFQpNAKK2RHv3puYur 0nxqUuT+gYoju9P+VRjHxGwO2kjxKf/itfl2yjalbBBLkNo1yVLwEvAkJ Ipv+IgCN/7Wn5vl21VsGhW4kpe+dzCxmHM4YuUgKOcE82pKnF5/GkcUPf Q==; X-CSE-ConnectionGUID: a1HG5DTwRR22chkDZ90nYQ== X-CSE-MsgGUID: n5ecdee3ScW9AXP238hQ5A== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697736" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697736" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:27 -0700 X-CSE-ConnectionGUID: uOnSajq+SHqiweNaKJZfCQ== X-CSE-MsgGUID: sOuJZ9vxSZe27Cn5lMcU9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362321" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:26 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 4/9] wifi: iwlwifi: mvm: remove STARTING state Date: Thu, 10 Oct 2024 14:05:02 +0300 Message-Id: <20241010140328.bb42b81b6c14.I622d5c1e88460e657958261d88cd18abb42cfb9c@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Johannes Berg While removing the retry loops, I neglected to also remove the bits of code that were added with the retry loops that prevented firmware restart, now that the retry loops no longer exist they need to also be removed so that restart/reprobe can happen. Fix that by removing the STARTING state and associated code. Fixes: dfdfe4be183b ("wifi: iwlwifi: remove retry loops in start") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 ------------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 --- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 --- 3 files changed, 19 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 62d55864b5df..819e1c0c46ca 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1295,20 +1295,7 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw) int ret; mutex_lock(&mvm->mutex); - - /* we are starting the mac not in error flow, and restart is enabled */ - if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) && - iwlwifi_mod_params.fw_restart) { - /* - * This will prevent mac80211 recovery flows to trigger during - * init failures - */ - set_bit(IWL_MVM_STATUS_STARTING, &mvm->status); - } - ret = __iwl_mvm_mac_start(mvm); - clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status); - mutex_unlock(&mvm->mutex); iwl_mvm_mei_set_sw_rfkill_state(mvm); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index ef07cff203b0..ec201a738d82 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1395,8 +1395,6 @@ DEFINE_GUARD(mvm, struct iwl_mvm *, mutex_lock(&_T->mutex), mutex_unlock(&_T->mu * @IWL_MVM_STATUS_IN_D3: in D3 (or at least about to go into it) * @IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE: suppress one error log * if this is set, when intentionally triggered - * @IWL_MVM_STATUS_STARTING: starting mac, - * used to disable restart flow while in STARTING state */ enum iwl_mvm_status { IWL_MVM_STATUS_HW_RFKILL, @@ -1408,7 +1406,6 @@ enum iwl_mvm_status { IWL_MVM_STATUS_FIRMWARE_RUNNING, IWL_MVM_STATUS_IN_D3, IWL_MVM_STATUS_SUPPRESS_ERROR_LOG_ONCE, - IWL_MVM_STATUS_STARTING, }; struct iwl_mvm_csme_conn_info { diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 4dd4a9d5c71f..8254701f5eba 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -2040,9 +2040,6 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error) */ if (!mvm->fw_restart && fw_error) { iwl_fw_error_collect(&mvm->fwrt, false); - } else if (test_bit(IWL_MVM_STATUS_STARTING, - &mvm->status)) { - IWL_ERR(mvm, "Starting mac, retry will be triggered anyway\n"); } else if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { struct iwl_mvm_reprobe *reprobe; From patchwork Thu Oct 10 11:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829954 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 4E4FD1C32FE for ; Thu, 10 Oct 2024 11:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558330; cv=none; b=sygUNViQqSBBzsC3ztS03ZG/XGJD7CPUDn6Zzly4CMNlSFuFa/T0sk695NHKP+96GhaOXNBHRrqMoKm0WBXQd4WTWs3UHJ/RfffFZbdmdueWutUbjOIG/zGTGzvnND80Qt0M8PlX6P7pYs3n09um4wa0Jz0dt2XNW+hMUvSjPlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558330; c=relaxed/simple; bh=j3LMXfx1i2LgR5ltVQ8hBW6+psbXDTuE60/dfP+o9CI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZeMXh2+IPecp+WiRET2C40321jbekID6eJzQdV7hD4ET9ACa9gAHu4tJk58udGV2QL/wzUQqrxhJWW3aade+0CF3KTtw0JxkjJHR92WdTQPbikhJrvn7rQMEL6zfbbzfYkRBqidaDMTHv2Ae3kwGM2hUtSvcxUHVfFJAm2c1DNk= 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=fPt1trjn; arc=none smtp.client-ip=198.175.65.14 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="fPt1trjn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558329; x=1760094329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j3LMXfx1i2LgR5ltVQ8hBW6+psbXDTuE60/dfP+o9CI=; b=fPt1trjniqLLxDcZd4qlLGXNOH446cyA9AWTNsQEoME1HZQZC+v2Elpc sJsiIbHcz0stWz01CAitxrF+/vEF6rWcOqUp3ewVO863qpjGvsFm1Kp1O OYTvNH1LiUAEfDItXrFe7bLybPveeTQOt76Idjue/bSfZbcEe6NA5G41b EyQEAi7bZrMcNR0dzzmwV2UyIV5rWO7KD8ruoVsnyk5U01KOZHoHxxVHw AZQADyUE9dkICcG6WmrprBJtbQI/q/0IRiYVRtLULzOxm8pvHdTxY8CoF hFcBcWR4GUwjP46xmRz8ffjp7Yavpo4TsCsmbPIyPnT8YilTYXyaBGzmQ A==; X-CSE-ConnectionGUID: mOgaLg4QQrqGOFJxbli+zw== X-CSE-MsgGUID: 7De9WOb5T+OuJD67gxiogQ== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697740" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697740" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:29 -0700 X-CSE-ConnectionGUID: Dz4C3l1ES3G8r9ssjz7VwA== X-CSE-MsgGUID: 3uJEuBpjS8ikXrtd630eUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362326" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:28 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay Subject: [PATCH 5/9] wifi: iwlwifi: mvm: Use the sync timepoint API in suspend Date: Thu, 10 Oct 2024 14:05:03 +0300 Message-Id: <20241010140328.9aae318cd593.I4b322009f39489c0b1d8893495c887870f73ed9c@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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 When starting the suspend flow, HOST_D3_START triggers an _async_ firmware dump collection for debugging purposes. The async worker may race with suspend flow and fail to get NIC access, resulting in the following warning: "Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)" Fix this by switching to the sync version to ensure the dump completes before proceeding with the suspend flow, avoiding potential race issues. Signed-off-by: Daniel Gabay Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/init.c | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c index d8b083be5b6b..de87e0e3e072 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c @@ -39,10 +39,12 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, } IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); +/* Assumes the appropriate lock is held by the caller */ void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt) { iwl_fw_suspend_timestamp(fwrt); - iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, NULL); + iwl_dbg_tlv_time_point_sync(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, + NULL); } IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 99a541d442bb..f4f87edb86e5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -1398,7 +1398,9 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) iwl_mvm_pause_tcm(mvm, true); + mutex_lock(&mvm->mutex); iwl_fw_runtime_suspend(&mvm->fwrt); + mutex_unlock(&mvm->mutex); return __iwl_mvm_suspend(hw, wowlan, false); } From patchwork Thu Oct 10 11:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829955 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 9834D1C3316 for ; Thu, 10 Oct 2024 11:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558332; cv=none; b=mZawmPKKBOmjPqCh2Bd7iOeQ814rIPTvhsMvpaQDFhBvQ8No/+cIarjoY/9QFxtaFWd5skzY0KzfBK0Ify0Hh2zBuj4AaiHpBclvXCjfTqiVyhcOB7YRqTd/Ti3Dk89NsaL8aFR3Z2nb9nY+MDvPjMlW1zrfzbZXSQ2oTKc/af8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558332; c=relaxed/simple; bh=Ao31ZAkhPCvQj+GZVD0jFba/9Vv8oA4aGHXpV5jlYR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kSYEMxdxaJgIvD3yvvcRnDsXke79U1Wj+MNmQZnP1h/xGb+Ox/HANGP7Q/5cnyCEtgg6nHCJAl0LJuYdJGhx98YCF7IPvjj2jTVH9pcYJOoqbwhXehNNyET43MEMhZUYnSuSkWZAMT1dp2j5ZMcIa53yU5BjK1Ml0+0g6BsorMQ= 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=O93VeC7q; arc=none smtp.client-ip=198.175.65.14 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="O93VeC7q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558330; x=1760094330; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Ao31ZAkhPCvQj+GZVD0jFba/9Vv8oA4aGHXpV5jlYR8=; b=O93VeC7qfLDJC3457VQ+8eFk1IM0mUKz0qpH2f3nTYkYegg3b5+Zr6/A n8KU6UFZCfNoYXPB1jwcmGePHXWVUjXezQ6LlR8PQTQpbcFrqkNsIhro9 T9hlzLtxYzEFkVsSW1TJ+fQAcV+lWYB/0sBIoMcTjvf2zRakgSGWO2tkc YU23hUYoLCNBUwCIt2vvw0nt2FZZKHDxUEgM0CUd0qZspmPT9Y4A/Czg0 YJFehhkylnqOqARfGtG91Oofm89iupRpY1YocJ+doTPll2whgE8Z2gGIs owitTxTSocghALOurj7y2AbFZDTc1EE/T1lN9EDZolRdUy3VQiGE/pCk5 Q==; X-CSE-ConnectionGUID: A+f9i5cURxS2gpX/iZex7A== X-CSE-MsgGUID: ZQsMTvqhQCq8AN9ycriAPA== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697744" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697744" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:30 -0700 X-CSE-ConnectionGUID: 1Cmt60KGT02awNxbbJJakA== X-CSE-MsgGUID: 1L/lkDFLS62T5TtBPhlhRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362333" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:29 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 6/9] wifi: iwlwifi: mvm: SAR table alignment Date: Thu, 10 Oct 2024 14:05:04 +0300 Message-Id: <20241010140328.f077aced4dee.I4dc618f12d01f7ad19f9f8881f6e09eea77e9a14@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Anjaneyulu SAR table format in ACPI and local data base are different, So modified code to read data properly. Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 96 ++++++++++++-------- 1 file changed, 58 insertions(+), 38 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index a7cea0a55b35..0bc32291815e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -429,38 +429,28 @@ int iwl_acpi_get_eckv(struct iwl_fw_runtime *fwrt, u32 *extl_clk) return ret; } -static int iwl_acpi_sar_set_profile(union acpi_object *table, - struct iwl_sar_profile *profile, - bool enabled, u8 num_chains, - u8 num_sub_bands) +static int +iwl_acpi_parse_chains_table(union acpi_object *table, + struct iwl_sar_profile_chain *chains, + u8 num_chains, u8 num_sub_bands) { - int i, j, idx = 0; - - /* - * The table from ACPI is flat, but we store it in a - * structured array. - */ - for (i = 0; i < BIOS_SAR_MAX_CHAINS_PER_PROFILE; i++) { - for (j = 0; j < BIOS_SAR_MAX_SUB_BANDS_NUM; j++) { + for (u8 chain = 0; chain < num_chains; chain++) { + for (u8 subband = 0; subband < BIOS_SAR_MAX_SUB_BANDS_NUM; + subband++) { /* if we don't have the values, use the default */ - if (i >= num_chains || j >= num_sub_bands) { - profile->chains[i].subbands[j] = 0; + if (subband >= num_sub_bands) { + chains[chain].subbands[subband] = 0; + } else if (table->type != ACPI_TYPE_INTEGER || + table->integer.value > U8_MAX) { + return -EINVAL; } else { - if (table[idx].type != ACPI_TYPE_INTEGER || - table[idx].integer.value > U8_MAX) - return -EINVAL; - - profile->chains[i].subbands[j] = - table[idx].integer.value; - - idx++; + chains[chain].subbands[subband] = + table->integer.value; + table++; } } } - /* Only if all values were valid can the profile be enabled */ - profile->enabled = enabled; - return 0; } @@ -543,9 +533,11 @@ int iwl_acpi_get_wrds_table(struct iwl_fw_runtime *fwrt) /* The profile from WRDS is officially profile 1, but goes * into sar_profiles[0] (because we don't have a profile 0). */ - ret = iwl_acpi_sar_set_profile(table, &fwrt->sar_profiles[0], - flags & IWL_SAR_ENABLE_MSK, - num_chains, num_sub_bands); + ret = iwl_acpi_parse_chains_table(table, fwrt->sar_profiles[0].chains, + num_chains, num_sub_bands); + if (!ret && flags & IWL_SAR_ENABLE_MSK) + fwrt->sar_profiles[0].enabled = true; + out_free: kfree(data); return ret; @@ -557,7 +549,7 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) bool enabled; int i, n_profiles, tbl_rev, pos; int ret = 0; - u8 num_chains, num_sub_bands; + u8 num_sub_bands; data = iwl_acpi_get_object(fwrt->dev, ACPI_EWRD_METHOD); if (IS_ERR(data)) @@ -573,7 +565,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) goto out_free; } - num_chains = ACPI_SAR_NUM_CHAINS_REV2; num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV2; goto read_table; @@ -589,7 +580,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) goto out_free; } - num_chains = ACPI_SAR_NUM_CHAINS_REV1; num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV1; goto read_table; @@ -605,7 +595,6 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) goto out_free; } - num_chains = ACPI_SAR_NUM_CHAINS_REV0; num_sub_bands = ACPI_SAR_NUM_SUB_BANDS_REV0; goto read_table; @@ -637,23 +626,54 @@ int iwl_acpi_get_ewrd_table(struct iwl_fw_runtime *fwrt) /* the tables start at element 3 */ pos = 3; + BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV0 != ACPI_SAR_NUM_CHAINS_REV1); + BUILD_BUG_ON(ACPI_SAR_NUM_CHAINS_REV2 != 2 * ACPI_SAR_NUM_CHAINS_REV0); + + /* parse non-cdb chains for all profiles */ for (i = 0; i < n_profiles; i++) { union acpi_object *table = &wifi_pkg->package.elements[pos]; + /* The EWRD profiles officially go from 2 to 4, but we * save them in sar_profiles[1-3] (because we don't * have profile 0). So in the array we start from 1. */ - ret = iwl_acpi_sar_set_profile(table, - &fwrt->sar_profiles[i + 1], - enabled, num_chains, - num_sub_bands); + ret = iwl_acpi_parse_chains_table(table, + fwrt->sar_profiles[i + 1].chains, + ACPI_SAR_NUM_CHAINS_REV0, + num_sub_bands); if (ret < 0) - break; + goto out_free; /* go to the next table */ - pos += num_chains * num_sub_bands; + pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; } + /* non-cdb table revisions */ + if (tbl_rev < 2) + goto set_enabled; + + /* parse cdb chains for all profiles */ + for (i = 0; i < n_profiles; i++) { + struct iwl_sar_profile_chain *chains; + union acpi_object *table; + + table = &wifi_pkg->package.elements[pos]; + chains = &fwrt->sar_profiles[i + 1].chains[ACPI_SAR_NUM_CHAINS_REV0]; + ret = iwl_acpi_parse_chains_table(table, + chains, + ACPI_SAR_NUM_CHAINS_REV0, + num_sub_bands); + if (ret < 0) + goto out_free; + + /* go to the next table */ + pos += ACPI_SAR_NUM_CHAINS_REV0 * num_sub_bands; + } + +set_enabled: + for (i = 0; i < n_profiles; i++) + fwrt->sar_profiles[i + 1].enabled = enabled; + out_free: kfree(data); return ret; From patchwork Thu Oct 10 11:05:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829956 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 186D71C233D for ; Thu, 10 Oct 2024 11:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558333; cv=none; b=nKnFV7rUsyAiic6QtezJSoXx6XqMEoOThi7z2KeO4QiMFouApk/wbw5sTAXSQLv9HCAKd7i4NQTo2Yv/uTb8ihkLN1/x34AQAf4e+oWLhj6G8Ekzxf9UptC8n3g1Z9VeEBzWvY6mFTuxzlmdFQKanUXFXts35vK6e117EyXyuEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558333; c=relaxed/simple; bh=kgE85E5qYH3RIjRT6vV0QZytKgELcDLkPnRluAEpDrk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P1HaaI1gx6ivsNN1oiZMr0ihR8zHqBFoZSWBXhtIfZpXXbphBbhZqcOOFeK9O0LZzxAWlX56bJJ54zUwlyNqdS7chWZR1NmtWgyD1ci7E30jJlPUaPEzI9G/GDuHiCUmndFzyAk/JpjH4rhs2qUweklgUIhywAGqtowkEghdilo= 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=U8z5lG33; arc=none smtp.client-ip=198.175.65.14 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="U8z5lG33" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558332; x=1760094332; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kgE85E5qYH3RIjRT6vV0QZytKgELcDLkPnRluAEpDrk=; b=U8z5lG33LOrJHibvjP+EObiXiVmhMYOp+YvueUsOsEBNv1R8HPANY8v8 Q82/9k4arZZK2jIfodbPrkl2Hoin2Y7WaLaHwll4qvERBJbyQ2qsxXeND BnnKJ4P+u7BovurebWsOvdF91AYDSIEPDhP9vq6wyG3btoyaOLTfWbawa r5CuHZv1MVCsFHnX82ln6ZTPz9N1i3ABKCnzPK7wzvpdrlFFsFIyNBmB1 AGg0Njl7LtzwQusTZ/hMWAevpTH6huRIKeCprjT2+996XoQ0DjlLzM3nX 1u1Sf8zEHrsFGpEzeczUX3Qu/+M7pW74Vok8wKVAfP7lbcsKV2RfN8qWQ g==; X-CSE-ConnectionGUID: vLn9dmwNTs2xcJSXnA4J7A== X-CSE-MsgGUID: scwdMAquRXGv/EyxR0/HoQ== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697746" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697746" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:32 -0700 X-CSE-ConnectionGUID: kts0Z5kZSPiXgurMmw2eZg== X-CSE-MsgGUID: 5pqcHfUQSnOKRyhawlOwww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362339" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:31 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay Subject: [PATCH 7/9] wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd() Date: Thu, 10 Oct 2024 14:05:05 +0300 Message-Id: <20241010140328.76c73185951e.Id3b6ca82ced2081f5ee4f33c997491d0ebda83f7@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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 1. The size of the response packet is not validated. 2. The response buffer is not freed. Resolve these issues by switching to iwl_mvm_send_cmd_status(), which handles both size validation and frees the buffer. Fixes: f130bb75d881 ("iwlwifi: add FW recovery flow") Signed-off-by: Daniel Gabay Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 08546e673cf5..f30b0fc8eca9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1307,8 +1307,8 @@ static void iwl_mvm_disconnect_iterator(void *data, u8 *mac, void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) { u32 error_log_size = mvm->fw->ucode_capa.error_log_size; + u32 status = 0; int ret; - u32 resp; struct iwl_fw_error_recovery_cmd recovery_cmd = { .flags = cpu_to_le32(flags), @@ -1316,7 +1316,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) }; struct iwl_host_cmd host_cmd = { .id = WIDE_ID(SYSTEM_GROUP, FW_ERROR_RECOVERY_CMD), - .flags = CMD_WANT_SKB, .data = {&recovery_cmd, }, .len = {sizeof(recovery_cmd), }, }; @@ -1336,7 +1335,7 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) recovery_cmd.buf_size = cpu_to_le32(error_log_size); } - ret = iwl_mvm_send_cmd(mvm, &host_cmd); + ret = iwl_mvm_send_cmd_status(mvm, &host_cmd, &status); kfree(mvm->error_recovery_buf); mvm->error_recovery_buf = NULL; @@ -1347,11 +1346,10 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags) /* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */ if (flags & ERROR_RECOVERY_UPDATE_DB) { - resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data); - if (resp) { + if (status) { IWL_ERR(mvm, "Failed to send recovery cmd blob was invalid %d\n", - resp); + status); ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_disconnect_iterator, From patchwork Thu Oct 10 11:05: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: 13829957 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 91A091C3F1A for ; Thu, 10 Oct 2024 11:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558335; cv=none; b=aqLw9tjKGoRfk2njnIdeLkMJI92/qbPl+fRX385uizSyHtS6lU4RE3C1q2W5ImqRmgJarPb5QNv3wSrrxAXbms3sbkOh7yPdm4RZbrq0Q8CQ3ZTkWNQZxjRU7ALiWFjPd6eNcKG3QzuG14eQWoJYezNuCBtXo5R9rmghml+RsYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558335; c=relaxed/simple; bh=QfbHHRqJxkAmYLAv4UWGXvJ6rOhkKxlRw63IVv4p1M8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=conNG9n1jQlpzPSapxyXSpdsO4cveRJhdtXcT5c47LXcLoffI6TjoRcKkijDRxh1E8BdIBCA59Xje434QQQVtQSKSVwCm+2jjnDVZA9dZVrPevkj3vFwEzXZ+QMNh1nUwSm4g7//DsBqwKnhX2mqpzRdgPAldTHEvevn+VSn6IQ= 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=CaIO4iYb; arc=none smtp.client-ip=198.175.65.14 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="CaIO4iYb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558333; x=1760094333; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QfbHHRqJxkAmYLAv4UWGXvJ6rOhkKxlRw63IVv4p1M8=; b=CaIO4iYb/fG/3Tcg5cU666k39ZZMv0gPBKpME2pwrpExVPo/6g5t0hZc AXvDhQd1r3JqDk/NF8VX0t5dOJO8ul2THbgCsSZtFXZwi6H2nb0KbcujK y1YG3+AlD3OViJkgY0AXQXCgQBvvV0+6/Siky7Ro+5OHpNN9ZiXy9ydkq cCc82BdDx/y+X3RGEuPo0r3CSk4aXAPyKLJLyBN24peWNgSnpkU17rPPh wZby6MeorHQ44HJKzVZrEEYX4GKnYc887WFkO8qBHOuWHUA0YX0oBwMi8 DJIkI+Bq46bN8n/pWJLvnm87zC88OKs2fexIFoEOFGCxJXCKnZ9KeXsu0 Q==; X-CSE-ConnectionGUID: oKF6lWbaSxuxwhLoNRK51Q== X-CSE-MsgGUID: tYz9wL2xT+KSsi/TqaJW6Q== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697749" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697749" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:33 -0700 X-CSE-ConnectionGUID: cEc0h7mITJOA33005SJqGw== X-CSE-MsgGUID: ENaQH4AsRcyMrhoNUw7R/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362344" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:32 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 8/9] wifi: iwlwifi: mvm: don't add default link in fw restart flow Date: Thu, 10 Oct 2024 14:05:06 +0300 Message-Id: <20241010140328.385bfea1b2e9.I4a127312285ccb529cc95cc4edf6fbe1e0a136ad@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Emmanuel Grumbach When we add the vif (and its default link) in fw restart we may override the link that already exists. We take care of this but if link 0 is a valid MLO link, then we will re-create a default link on mvmvif->link[0] and we'll loose the real link we had there. In non-MLO, we need to re-create the default link upon the interface creation, this is fine. In MLO, we'll just wait for change_vif_links() to re-build the links. Fixes: bf976c814c86 ("wifi: iwlwifi: mvm: implement link change ops") Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index bd043db906db..e252f0dcea20 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -41,8 +41,6 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw, /* reset deflink MLO parameters */ mvmvif->deflink.fw_link_id = IWL_MVM_FW_LINK_ID_INVALID; mvmvif->deflink.active = 0; - /* the first link always points to the default one */ - mvmvif->link[0] = &mvmvif->deflink; ret = iwl_mvm_mld_mac_ctxt_add(mvm, vif); if (ret) @@ -60,9 +58,19 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw, IEEE80211_VIF_SUPPORTS_CQM_RSSI; } - ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); - if (ret) - goto out_free_bf; + /* We want link[0] to point to the default link, unless we have MLO and + * in this case this will be modified later by .change_vif_links() + * If we are in the restart flow with an MLD connection, we will wait + * to .change_vif_links() to setup the links. + */ + if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || + !ieee80211_vif_is_mld(vif)) { + mvmvif->link[0] = &mvmvif->deflink; + + ret = iwl_mvm_add_link(mvm, vif, &vif->bss_conf); + if (ret) + goto out_free_bf; + } /* Save a pointer to p2p device vif, so it can later be used to * update the p2p device MAC when a GO is started/stopped @@ -1194,7 +1202,11 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw, mutex_lock(&mvm->mutex); - if (old_links == 0) { + /* If we're in RESTART flow, the default link wasn't added in + * drv_add_interface(), and link[0] doesn't point to it. + */ + if (old_links == 0 && !test_bit(IWL_MVM_STATUS_IN_HW_RESTART, + &mvm->status)) { err = iwl_mvm_disable_link(mvm, vif, &vif->bss_conf); if (err) goto out_err; From patchwork Thu Oct 10 11:05:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13829958 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 04E011C2439 for ; Thu, 10 Oct 2024 11:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558336; cv=none; b=bqcz0BXA5g6neWU4X63KF0IK6TjO0F+j77X1jvRLK1BBfqVJsgssiwe0RFyailks/HRbiJ/c0Uy6qRzcaS4ZZnsT54yxXENjC3CyrfPU4rTtrm+RPAyRF8utLoYwZTYy344vCEzVmPuVrAZ45DqmUeYO7c3czbbXZn9u3Vs5MiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558336; c=relaxed/simple; bh=3ECqspv3YmPba6PIxQUUN4ClaJatIPZn/x4TEOVwLNM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kVpiHyNtaBq2TUSBoetM1IeEeHKe2e8wbyIunaxv3FnQzV8sOGAhxUGjwiVKfqXHJSnKXVqQvi8s1T1gSHWNscoCvZk8F1gsMZSWohxyigzdChH5/xlKh3xxs7A3IojmFs8T4A5sZUEgQdSYRvC1q32tvMplpnnTM0WVOtj2J5Q= 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=Hc8DfKnL; arc=none smtp.client-ip=198.175.65.14 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="Hc8DfKnL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558335; x=1760094335; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3ECqspv3YmPba6PIxQUUN4ClaJatIPZn/x4TEOVwLNM=; b=Hc8DfKnLTMdmGg+x/D6F6SP+nEdIRceS7xSTcdm/HGPV42gm/1X0madW 3ZwX1ezBqglNmvvC472bfBPkifF59t+ofQ9HG/iEcaDZgS20PQWj1iHOs Xqy2DiyKmkEAQPMZH/3fmCvUUDUVH7k6C7WWbMUUg5tWOUJ936AgEhECZ Hq6rElfzXQ+aw/aGRFyF3lXYvEPrwLeNQrzXkffyT4EtarCNmooK72TZz bIBhrKVJNvcv9woWc4nGlVDlPdkR3I7lA0Jb64L86gyiIT+EU+0T+qxmr kHaQ+iz0IyCiEIGfnYESSs+EEujQR3XXR9e1DSy+OLvzM278wzeU6YGzA w==; X-CSE-ConnectionGUID: +YIPY6OQRaKLi/EZXVRQtw== X-CSE-MsgGUID: Cf5Ao8WLSr+DdRYIIhe4nA== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697751" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697751" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:34 -0700 X-CSE-ConnectionGUID: t/iDAKXnSKqqVwsk1CWUKw== X-CSE-MsgGUID: kaujwZ4BQLmJfztswdFHlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362348" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:34 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 9/9] wifi: iwlwifi: mvm: tell iwlmei when we finished suspending Date: Thu, 10 Oct 2024 14:05:07 +0300 Message-Id: <20241010140328.1dc3a7fea9d1.Ibf183824471ea5580d9276d104444e53191e6900@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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: Emmanuel Grumbach Since we no longer shut down the device in suspend, we also no longer call iwl_mvm_mei_device_state() and this is a problem because iwlmei expects this to be called when it runs its own suspend sequence. It checks mei->device_down in iwl_mei_remove() which is called upon suspend. Fix this by telling iwlmei when we're done accessing the device. When we'll wake up, the device should be untouched if CSME didn't use it during the suspend time. If CSME used it, we'll notice it through the CSR_FUNC_SCRATCH register. Fixes: e8bb19c1d590 ("wifi: iwlwifi: support fast resume") Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 819e1c0c46ca..db0c6e7a186b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1237,6 +1237,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm) fast_resume = mvm->fast_resume; if (fast_resume) { + iwl_mvm_mei_device_state(mvm, true); ret = iwl_mvm_fast_resume(mvm); if (ret) { iwl_mvm_stop_device(mvm); @@ -1356,10 +1357,13 @@ void __iwl_mvm_mac_stop(struct iwl_mvm *mvm, bool suspend) iwl_mvm_rm_aux_sta(mvm); if (suspend && - mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) + mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) { iwl_mvm_fast_suspend(mvm); - else + /* From this point on, we won't touch the device */ + iwl_mvm_mei_device_state(mvm, false); + } else { iwl_mvm_stop_device(mvm); + } iwl_mvm_async_handlers_purge(mvm); /* async_handlers_list is empty and will stay empty: HW is stopped */