From patchwork Sun Aug 25 16:17:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823129 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 ABA343D62 for ; Sun, 25 Aug 2024 16:17:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602647; cv=none; b=Z+s2LdUbmX5YU58DPY/9fwdWRg3pRqlgYaHIARphT2fRwSVaU2d4j2b1QBZdN7C6v3MlqC1OZpuZLeTGVDVgddthk+seh1wK2MnnKK8vUKnVMeEOTINRvI97UCWvVsLQwBJjX4OD6QQRFjNQm8nGPC1q3Q0aKLv4lCM3Yq9iXFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602647; c=relaxed/simple; bh=bIY3OQaAg60s4nl8POxPLxdBAv21lmsQr+rSfG+Z0Xc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jrB2rrw9ISn1fO0/z0mcjhF6BV//Pm87oyEmsmF0kIKAOKEo1hktIkjzIVbuML0l91rZXRDfvFJfOyLgzzzK1kIH0tFlojoyNyS8/SzeE3RjPsBZFX6ymPcfmsCAh5URDZihkY8DqX7vmeZxQDsswhCoPByRxD8UoyI9Wnp3dyw= 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=lOFMyQUg; arc=none smtp.client-ip=192.198.163.18 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="lOFMyQUg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602645; x=1756138645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bIY3OQaAg60s4nl8POxPLxdBAv21lmsQr+rSfG+Z0Xc=; b=lOFMyQUgoH45GRq8jjkFpM77gqtkGR4+0dneHbbecHKpj+Kz6Q4ep8kr mFAmwhxBboUfVX+ZJccAerXu8q92pSUNfaX1q/xKEBHvTAKBYQTr61o0K COSeCUJ16reCHq2mjdHOJPgKcAXekMnkY9KJJeZ9cqmWPkCzSDVGDYsla ykwoTGqxC51q7/cjWOpQcjP4MjWO+LSv15K0Bi64+WtULk6mTIpkcnAGu qaAOjnEg/OMM0C8TfBHo3me7lJlAO0Dqt9GG1+2iWwo6kqNHgDQn2MCZP p9/yWoPys6KfaK13d+euDr1zStgXDFyN37e3NgSJiSEcKJsRsIZyJCKax A==; X-CSE-ConnectionGUID: LDc7lwIsQsW9FgnrqnsTHQ== X-CSE-MsgGUID: qwi3wqhnTaKlLQzNgEA+bg== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544116" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544116" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:25 -0700 X-CSE-ConnectionGUID: smoCX8MeTmGXUK3F905Pww== X-CSE-MsgGUID: hzC/a5FtRbOdtnGQRXVYow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999725" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:23 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 01/13] wifi: iwlwifi: clear trans->state earlier upon error Date: Sun, 25 Aug 2024 19:17:01 +0300 Message-Id: <20240825191257.9d7427fbdfd7.Ia056ca57029a382c921d6f7b6a6b28fc480f2f22@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 the firmware crashes, we first told the op_mode and only then, changed the transport's state. This is a problem if the op_mode's nic_error() handler needs to send a host command: it'll see that the transport's state still reflects that the firmware is alive. Today, this has no consequences since we set the STATUS_FW_ERROR bit and that will prevent sending host commands. iwl_fw_dbg_stop_restart_recording looks at this bit to know not to send a host command for example. In the next patch, we will need to reset the firmware without having an error and checking STATUS_FW_ERROR to see whether the firmware is alive will no longer hold. Change the flow a bit. Change trans->state before calling the op_mode's nic_error() method and check trans->state instead of STATUS_FW_ERROR. This will keep the current behavior of iwl_fw_dbg_stop_restart_recording upon firmware error, and it'll allow us to call iwl_fw_dbg_stop_restart_recording safely even if STATUS_FW_ERROR is clear, but yet, the firmware is not alive. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index fa57df336785..fb2ea38e89ac 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c @@ -3348,7 +3348,7 @@ void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt, { int ret __maybe_unused = 0; - if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status)) + if (!iwl_trans_fw_running(fwrt->trans)) return; if (fw_has_capa(&fwrt->fw->ucode_capa, diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h index 6148acbac6af..0ef48effeefb 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h @@ -1128,8 +1128,8 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync) /* prevent double restarts due to the same erroneous FW */ if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) { - iwl_op_mode_nic_error(trans->op_mode, sync); trans->state = IWL_TRANS_NO_FW; + iwl_op_mode_nic_error(trans->op_mode, sync); } } From patchwork Sun Aug 25 16:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822430 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 A281DE56E for ; Sun, 25 Aug 2024 16:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602649; cv=none; b=tuVQxN3tIgqnhuGxxsph4fvOeA9sVrWzaEbPg7LOG6YjkDKmVQtiCiypCuMQugEcaSM//fZBe5D6gBhXIcXDmbBTrZXMrjX9rSN+N0cICybbipiPdgpquRt5MG5NBgIeTZ5l2Q1FcObcCqH6hs1KYqqFATwDrOuomzgqO36e7tI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602649; c=relaxed/simple; bh=S5XK7T5zLly+54sSle9RmoMNVRT7fZzF7Kf2iX7maNs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V/hkUbj8HM/MICMDI993e4w6c6XBgJs7BpunuyauJuHwjj4LjYaQDlAFAGB+wRaQHgDUEHB2OznQbLKWfyqODJLcUBmAQJvoa6dfWzh7Axlouf9CUuoU5ysUd1xEms+DWqO5PekNC+zuO3c2qBE9BDdePpHavumkd9u1LFuOuWg= 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=Ru9qNvPG; arc=none smtp.client-ip=192.198.163.18 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="Ru9qNvPG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602646; x=1756138646; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S5XK7T5zLly+54sSle9RmoMNVRT7fZzF7Kf2iX7maNs=; b=Ru9qNvPGWD+3P27HFfAkxmjmey8BrXNXkGg5H165cZhD68Vn4BbC3HQK L55NUkZe/wYI/9mDH0l0WAeO2ZMpmAR5ekTxQnigHw4brpSKMxmAfeHb8 +a/7/6zKtQNvJlTVwAgS+FWhUc8HfWLUQl6q1Kesx0+DNIIK3OyqJWFJA YmD9+ilp707SWIdZRnpjyr3TkS6utVsEViuibD2x7diK0cE7LeQ8aIeuc zUv2jpkALcNxKN8sDLMWctDvkSNpm7UEPQikvoHokp+n9YXSC/Iwa0ayk bMTDvRNsMteuAPL0GTjwE6KG6k1cMmyTxfoI/qhsnox8yKMjfA60HZRJ2 Q==; X-CSE-ConnectionGUID: d0D+RmjHTeqtR0vGedNK1g== X-CSE-MsgGUID: 47vlNMMDSOqCMSSxACyd4w== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544118" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544118" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:26 -0700 X-CSE-ConnectionGUID: Bh8sRbBkSH6P/uLFHyFdBA== X-CSE-MsgGUID: /rlDXVAzRYGu7o1h8rf2cw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999729" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:25 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 02/13] wifi: iwlwifi: mvm: fix hibernation Date: Sun, 25 Aug 2024 19:17:02 +0300 Message-Id: <20240825191257.24eb3b19e74f.I3837810318dbef0a0a773cf4c4fcf89cdc6fdbd3@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 Fast resume is a feature that was recently introduced to speed up the resume time. It basically keeps the firmware alive while the system is suspended and that avoids starting again the whole device. This flow can't work for hibernation, since when the system boots, before the frozen image is loaded, the kernel may touch the device. As a result, we can't assume the device is in the exact same state as before the hibernation. Detect that we are resuming from hibernation through the PCI device and forbid the fast resume flow. We also need to shut down the device cleanly when that happens. In addition, in case the device is power gated during S3, we won't be able to keep the device alive. Detect this situation with BE200 at least with the help of the CSR_FUNC_SCRATCH register and reset the device upon resume if it was power gated during S3. Fixes: e8bb19c1d590 ("wifi: iwlwifi: support fast resume") Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/iwl-op-mode.h | 12 ++++++ drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 10 +++++ drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 17 +++++++- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 41 +++++++++++++++++-- 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h index 595fa6ddf084..8ef5ed2db051 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h @@ -85,6 +85,10 @@ struct iwl_cfg; * May sleep * @wimax_active: invoked when WiMax becomes active. May sleep * @time_point: called when transport layer wants to collect debug data + * @device_powered_off: called upon resume from hibernation but not only. + * Op_mode needs to reset its internal state because the device did not + * survive the system state transition. The firmware is no longer running, + * etc... */ struct iwl_op_mode_ops { struct iwl_op_mode *(*start)(struct iwl_trans *trans, @@ -107,6 +111,7 @@ struct iwl_op_mode_ops { void (*time_point)(struct iwl_op_mode *op_mode, enum iwl_fw_ini_time_point tp_id, union iwl_dbg_tlv_tp_data *tp_data); + void (*device_powered_off)(struct iwl_op_mode *op_mode); }; int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops); @@ -204,4 +209,11 @@ static inline void iwl_op_mode_time_point(struct iwl_op_mode *op_mode, op_mode->ops->time_point(op_mode, tp_id, tp_data); } +static inline void iwl_op_mode_device_powered_off(struct iwl_op_mode *op_mode) +{ + if (!op_mode || !op_mode->ops || !op_mode->ops->device_powered_off) + return; + op_mode->ops->device_powered_off(op_mode); +} + #endif /* __iwl_op_mode_h__ */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index b4d650583ac2..99a541d442bb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -3439,6 +3439,16 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) mutex_lock(&mvm->mutex); + /* Apparently, the device went away and device_powered_off() was called, + * don't even try to read the rt_status, the device is currently + * inaccessible. + */ + if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { + IWL_INFO(mvm, + "Can't resume, device_powered_off() was called during wowlan\n"); + goto err; + } + mvm->last_reset_or_resume_time_jiffies = jiffies; /* get the BSS vif pointer again */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index b7dcae76a05d..75fc60a4808c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -2090,6 +2090,20 @@ static void iwl_op_mode_mvm_time_point(struct iwl_op_mode *op_mode, iwl_dbg_tlv_time_point(&mvm->fwrt, tp_id, tp_data); } +static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode) +{ + struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); + + mutex_lock(&mvm->mutex); + clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); + mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; + iwl_mvm_stop_device(mvm); +#ifdef CONFIG_PM + mvm->fast_resume = false; +#endif + mutex_unlock(&mvm->mutex); +} + #define IWL_MVM_COMMON_OPS \ /* these could be differentiated */ \ .queue_full = iwl_mvm_stop_sw_queue, \ @@ -2102,7 +2116,8 @@ static void iwl_op_mode_mvm_time_point(struct iwl_op_mode *op_mode, /* as we only register one, these MUST be common! */ \ .start = iwl_op_mode_mvm_start, \ .stop = iwl_op_mode_mvm_stop, \ - .time_point = iwl_op_mode_mvm_time_point + .time_point = iwl_op_mode_mvm_time_point, \ + .device_powered_off = iwl_op_mode_mvm_device_powered_off static const struct iwl_op_mode_ops iwl_mvm_ops = { IWL_MVM_COMMON_OPS, diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index 9ad43464b702..84fd93278450 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -1577,11 +1577,12 @@ static int iwl_pci_suspend(struct device *device) return 0; } -static int iwl_pci_resume(struct device *device) +static int _iwl_pci_resume(struct device *device, bool restore) { struct pci_dev *pdev = to_pci_dev(device); struct iwl_trans *trans = pci_get_drvdata(pdev); struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); + bool device_was_powered_off = false; /* Before you put code here, think about WoWLAN. You cannot check here * whether WoWLAN is enabled or not, and your code will run even if @@ -1597,6 +1598,26 @@ static int iwl_pci_resume(struct device *device) if (!trans->op_mode) return 0; + /* + * Scratch value was altered, this means the device was powered off, we + * need to reset it completely. + * Note: MAC (bits 0:7) will be cleared upon suspend even with wowlan, + * so assume that any bits there mean that the device is usable. + */ + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ && + !iwl_read32(trans, CSR_FUNC_SCRATCH)) + device_was_powered_off = true; + + if (restore || device_was_powered_off) { + trans->state = IWL_TRANS_NO_FW; + /* Hope for the best here ... If one of those steps fails we + * won't really know how to recover. + */ + iwl_pcie_prepare_card_hw(trans); + iwl_finish_nic_init(trans); + iwl_op_mode_device_powered_off(trans->op_mode); + } + /* In WOWLAN, let iwl_trans_pcie_d3_resume do the rest of the work */ if (test_bit(STATUS_DEVICE_ENABLED, &trans->status)) return 0; @@ -1617,9 +1638,23 @@ static int iwl_pci_resume(struct device *device) return 0; } +static int iwl_pci_restore(struct device *device) +{ + return _iwl_pci_resume(device, true); +} + +static int iwl_pci_resume(struct device *device) +{ + return _iwl_pci_resume(device, false); +} + static const struct dev_pm_ops iwl_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(iwl_pci_suspend, - iwl_pci_resume) + .suspend = pm_sleep_ptr(iwl_pci_suspend), + .resume = pm_sleep_ptr(iwl_pci_resume), + .freeze = pm_sleep_ptr(iwl_pci_suspend), + .thaw = pm_sleep_ptr(iwl_pci_resume), + .poweroff = pm_sleep_ptr(iwl_pci_suspend), + .restore = pm_sleep_ptr(iwl_pci_restore), }; #define IWL_PM_OPS (&iwl_dev_pm_ops) From patchwork Sun Aug 25 16:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823128 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 5D16A15B108 for ; Sun, 25 Aug 2024 16:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602650; cv=none; b=ktLhtDY/TxsCq1Q+B40nv72JpfiY4UlhONfEDWjgWv2DYYAfZDKcGOMEvzHaj/CyBS+n+ff5C/DbY5H8WBG8Yk4mj9oUa5S4DlcJbH1T/T2JoLWYMsuHGS7t8KkmZPhop0PUd5uzJR7fHuDe6UGCSJGsVj0jAHpF0M+UsxqVN5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602650; c=relaxed/simple; bh=6Kts3oIxkH6mXSXB5TdQhv4gczf++rmG/lW82lT0mrs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L6ownP5lc3iDqjhyfg8WNF9VnkO9i1AVTrzUVLBFcJQfdv0k3KRX2VAnWzTMMxA363CXfTl3LX5CKtmfcc+xeb/EAU4BEHynQX8hzJmQFh96LtVg7P4w+B9C/8y6xApQrRSnFYrmvFgahAkjCu4sBAoIVQ7ZuaxRpiQ41DRBKxQ= 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=evXab46a; arc=none smtp.client-ip=192.198.163.18 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="evXab46a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602648; x=1756138648; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6Kts3oIxkH6mXSXB5TdQhv4gczf++rmG/lW82lT0mrs=; b=evXab46apUByNgVDlDvRL8P9dbBNAlWwYQdGPkZ6+XlkqwIPfE/Zshug JwUWrF/764MkITnXYdNn3zEJDomqixJK1iH023y+ksBKPz2D7ZD+emUc1 3AS3YE84wmPeuXt1HJOeQJiVptlAEcYhp3dzNkR5cu7iaBjOQlUGOBGnb SlEV2RomowQ6aQk2pOWEUDWuD5EAJJqpgDESCICYtvkrYP5xqaU4i3eIl FUZ8dtxsHwBNqp5i41UZZ/PL7yd1FErOn0Vzpmm9wM+4QgB3iA8Vj92fx HPW/DOJ3Ni9Fq1MDgku88O2AWZ66LPmTB/410tG49Ovwsy1fkhnChZjfE A==; X-CSE-ConnectionGUID: aV+FAgUfSKq1DJtAgABrQg== X-CSE-MsgGUID: bbgtuPX6SV2sKlucRtv3nQ== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544121" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544121" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:27 -0700 X-CSE-ConnectionGUID: JlXoksXzShmFgfFZXzVhRQ== X-CSE-MsgGUID: kRCUmTxuRSC/pSvEkXAong== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999732" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:26 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 03/13] wifi: iwlwifi: mvm: replace CONFIG_PM by CONFIG_PM_SLEEP Date: Sun, 25 Aug 2024 19:17:03 +0300 Message-Id: <20240825191257.44e47ba584de.I64f985d0405345252b76b7157291b79677abd64d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 Replace the ifdef CONFIG_PM by CONFIG_PM_SLEEP. CONFIG_PM was useful when we had CONFIG_PM_RUNTIME but that was removed long ago. Use PM_SLEEP consistently across the driver. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/Makefile | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 +++--- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 7 +++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/Makefile b/drivers/net/wireless/intel/iwlwifi/mvm/Makefile index 8873904f51ec..59751f123571 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/Makefile +++ b/drivers/net/wireless/intel/iwlwifi/mvm/Makefile @@ -13,7 +13,7 @@ iwlmvm-y += ptp.o iwlmvm-y += time-sync.o iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o -iwlmvm-$(CONFIG_PM) += d3.o +iwlmvm-$(CONFIG_PM_SLEEP) += d3.o iwlmvm-$(CONFIG_IWLMEI) += vendor-cmd.o subdir-ccflags-y += -I $(src)/../ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 835a05b91833..7236ff7277ce 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -1241,7 +1241,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm) mvm->nvm_data = NULL; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP /* fast_resume will be cleared by iwl_mvm_fast_resume */ fast_resume = mvm->fast_resume; @@ -1263,7 +1263,7 @@ int __iwl_mvm_mac_start(struct iwl_mvm *mvm) set_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); } } -#endif /* CONFIG_PM */ +#endif /* CONFIG_PM_SLEEP */ if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) { /* diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 22f48b66d79c..78af0a167730 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -508,7 +508,7 @@ struct iwl_mvm_vif { bool bf_enabled; bool ba_enabled; -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP /* WoWLAN GTK rekey data */ struct { u8 kck[NL80211_KCK_EXT_LEN]; @@ -1176,7 +1176,7 @@ struct iwl_mvm { struct ieee80211_vif *p2p_device_vif; -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP struct wiphy_wowlan_support wowlan; int gtk_ivlen, gtk_icvlen, ptk_ivlen, ptk_icvlen; @@ -2291,7 +2291,7 @@ void iwl_mvm_ipv6_addr_change(struct ieee80211_hw *hw, void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int idx); extern const struct file_operations iwl_dbgfs_d3_test_ops; -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif); void iwl_mvm_fast_suspend(struct iwl_mvm *mvm); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 75fc60a4808c..1cc5667340e8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -2090,6 +2090,7 @@ static void iwl_op_mode_mvm_time_point(struct iwl_op_mode *op_mode, iwl_dbg_tlv_time_point(&mvm->fwrt, tp_id, tp_data); } +#ifdef CONFIG_PM_SLEEP static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode) { struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); @@ -2098,11 +2099,13 @@ static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode) clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status); mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_DISABLED; iwl_mvm_stop_device(mvm); -#ifdef CONFIG_PM mvm->fast_resume = false; -#endif mutex_unlock(&mvm->mutex); } +#else +static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode) +{} +#endif #define IWL_MVM_COMMON_OPS \ /* these could be differentiated */ \ From patchwork Sun Aug 25 16:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822429 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 C9BFD16BE1C for ; Sun, 25 Aug 2024 16:17:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602651; cv=none; b=H6x42MyWUli2hjCsYRWrQq0Smn2nCPm55S1jRc3jC/z0FPGqp7dYX/FWvj2mF4lJm2cko7cm3qh+ljmP59AiOFZTTqGJHqblCPOa+bMpfWmDVOVg+oCXSrYW4mGJXJKmtG0v9wMleXN72j0Nr2cMZK7oU8yWNUjsYStTeNXKlOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602651; c=relaxed/simple; bh=UETGaDT7mDaLgwscxlnaZu2HAsMYoP0Ni2SvwHqlz5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jw/tqUEKQmlBRSCTs/1QO6YAfzQqUPAFsm2WnU9PCevO+dN+1lVfQ4W27HKxa6HNaBap1NptX60ogEukKv8l0AgyVkdMuKyeL/SLv+R9o/eW4FpxcCi3jtnZwqDxZdssNBTMXTmAzBjwjtGPIsJmzcMdlWSWPBEQ4kI50IowdgM= 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=e9N0/NO+; arc=none smtp.client-ip=192.198.163.18 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="e9N0/NO+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602649; x=1756138649; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UETGaDT7mDaLgwscxlnaZu2HAsMYoP0Ni2SvwHqlz5Y=; b=e9N0/NO+G22JvNRI9ZmNUgH+UNiSSA7Zt6w/LFudXsfvQ7HMlEg7oigw XEsVNbabN+G5EWVh353nMG+qTTIB5IModcRK3UnI6r4yvu5qDAPNNG2Fn ht6Uj/6AO7jg3Mhqkdp+xGmTIwdpTHW6JGb0HuIlv5k12pD2MpreSjfLA chPGI5tH1fDIibX9yPMsZSMMFj3x3Y0QTTQiIqJKJihvSc7AYXUkoLFDE 4NViIJ+0CTaxGIvVS0cri1khBmFm2vjYLa8gm0OCp/eYhmts8liGki08H 7Um+51tKZMvzHJnljVPJwkZjlLlQMw7h5womhyemGTtHMNbmKw6aJnhcm A==; X-CSE-ConnectionGUID: C2ULjcRTTmi9dxK3wcwZTg== X-CSE-MsgGUID: pwzx+vczQKmTxZTyjxRWQA== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544123" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544123" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:29 -0700 X-CSE-ConnectionGUID: cSN7O//rQWW3gUmxa4Gsiw== X-CSE-MsgGUID: XcNr48+dShSAoZu0pAnTbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999738" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:27 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 04/13] wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead Date: Sun, 25 Aug 2024 19:17:04 +0300 Message-Id: <20240825191257.a7cbd794cee9.I44a739fbd4ffcc46b83844dd1c7b2eb0c7b270f6@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 There is a WARNING in iwl_trans_wait_tx_queues_empty() which we hit it's become a WARNING. The problem is that we can't expect anything from the firmware after it's declared dead. Don't call iwl_trans_wait_tx_queues_empty() in this case. While it could be a good idea to stop the flow earlier, the flush functions do some maintenance work that is not related to the firmware, so keep that part of the code running even when the firmware is not running. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 7236ff7277ce..5544426dfd1a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -5818,6 +5818,10 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) int i; if (!iwl_mvm_has_new_tx_api(mvm)) { + /* we can't ask the firmware anything if it is dead */ + if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, + &mvm->status)) + return; if (drop) { guard(mvm)(mvm); iwl_mvm_flush_tx_path(mvm, @@ -5911,8 +5915,11 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, /* this can take a while, and we may need/want other operations * to succeed while doing this, so do it without the mutex held + * If the firmware is dead, this can't work... */ - if (!drop && !iwl_mvm_has_new_tx_api(mvm)) + if (!drop && !iwl_mvm_has_new_tx_api(mvm) && + !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, + &mvm->status)) iwl_trans_wait_tx_queues_empty(mvm->trans, msk); } From patchwork Sun Aug 25 16:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823127 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 F0C6816EC0E for ; Sun, 25 Aug 2024 16:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602652; cv=none; b=VVQq38twtkhAuakPN+w2/0VGrto0Kh0XEUOo99fq2ftNwyNDY6Mrc0F0ygGvTTnfkisXTFR6qDw8hyuaolwC4WVduCVuj+vkYoUPaeUYbK5baVdtxpqzwqLDLSypr5EZfVnDeHuAdFT7BDL8dO0XPipChqNu++1SG80H81j76+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602652; c=relaxed/simple; bh=fJKK3Ij6AJ65NLokDieLiXU7tz2fTPxoxhuX1jQXE/w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Idh0NbS0yBNigG9qP/Rar2rjPQfFYk5x7ddSMjUF+cNiN6kOWmESaCKCH1XlIlrs7i7J2NXNpPvWuwgvSGDkSxRQCy9WfN7K/Pb0J7WN5oDmd3gSOIvZXioQzVkzAxTXH0OT2na3nHWyvkk3j7JSJqhbe8UZkiLueeAzOKR0zAE= 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=UjHeTsgM; arc=none smtp.client-ip=192.198.163.18 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="UjHeTsgM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602651; x=1756138651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fJKK3Ij6AJ65NLokDieLiXU7tz2fTPxoxhuX1jQXE/w=; b=UjHeTsgM+gsthK1lWpvYVzeO4BQ3qMwcmgE2Y1QRfsC/RDzhMKJ3nkzh 75wjrNkWVj7aQIgop4VFrrwfJntBSRUvFVu2NzDKtPmcXBsG+Z2v/abha qLSM70bcjoXlLBSLUC89FTzQc76fwywiysuZvtQsev3T8ZAHMvVb3P3+z nalqEZaOSAc5lnK+tFEF9JmfkIOqNeVgsOrU/9PiaTEAYLFsbkfMSPXIH 0Db7a/NFeNdGGoHSOmP7MHxovnGRJVJzK3CXh8mvzbfuBCSrGE4xOjP35 4PaWdZqY53SdTjpegaEthVZvvbnZwYoQGhMwFf9+iaWx3Uo4CIFc/V+Lx g==; X-CSE-ConnectionGUID: FjLsm8BaRO6bMDvmXhjCKg== X-CSE-MsgGUID: /TDvRmgGQ1yJ5lT+pcLFcw== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544125" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544125" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:30 -0700 X-CSE-ConnectionGUID: 9U2E7YmHSzOsOkTRkjpXcQ== X-CSE-MsgGUID: 4eUK4lJMQea6Eh5ctP1s5w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999741" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:29 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Ilan Peer Subject: [PATCH 05/13] wifi: iwlwifi: mvm: fix iwl_mvm_scan_fits() calculation Date: Sun, 25 Aug 2024 19:17:05 +0300 Message-Id: <20240825191257.7db825442fd2.I99f4d6587709de02072fd57957ec7472331c6b1d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 The calculation should consider also the 6GHz IE's len, fix that. In addition, in iwl_mvm_sched_scan_start() the scan_fits helper is called only in case non_psc_incldued is true, but it should be called regardless, fix that as well. Signed-off-by: Daniel Gabay Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index 8e0df31f1b3e..ecd9d301e88b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -837,8 +837,8 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, return ((n_ssids <= PROBE_OPTION_MAX) && (n_channels <= mvm->fw->ucode_capa.n_scan_channels) & (ies->common_ie_len + - ies->len[NL80211_BAND_2GHZ] + - ies->len[NL80211_BAND_5GHZ] <= + ies->len[NL80211_BAND_2GHZ] + ies->len[NL80211_BAND_5GHZ] + + ies->len[NL80211_BAND_6GHZ] <= iwl_mvm_max_scan_ie_fw_cmd_room(mvm))); } @@ -3168,18 +3168,16 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, params.n_channels = j; } - if (non_psc_included && - !iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { - kfree(params.channels); - return -ENOBUFS; + if (!iwl_mvm_scan_fits(mvm, req->n_ssids, ies, params.n_channels)) { + ret = -ENOBUFS; + goto out; } uid = iwl_mvm_build_scan_cmd(mvm, vif, &hcmd, ¶ms, type); - - if (non_psc_included) - kfree(params.channels); - if (uid < 0) - return uid; + if (uid < 0) { + ret = uid; + goto out; + } ret = iwl_mvm_send_cmd(mvm, &hcmd); if (!ret) { @@ -3197,6 +3195,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, mvm->sched_scan_pass_all = SCHED_SCAN_PASS_ALL_DISABLED; } +out: + if (non_psc_included) + kfree(params.channels); return ret; } From patchwork Sun Aug 25 16:17:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822428 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 95A3E16BE1C for ; Sun, 25 Aug 2024 16:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602654; cv=none; b=Ka+8OOGLnCbYS0aqKx/IhTRnpJ5l7EZ3HW1LwgSRTfhIdnc7cFOeJIwOSDFdMSn8azJ5AsRHNYS8Ig8MEDz8CltfU1KX9ImrvHo/4td0TDyXH98wxeN818/UtzKM89shAtahaVwXBYyKaZnxYrXzjAEMt+CWkkNPeCPG0Zl9oLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602654; c=relaxed/simple; bh=xU/utmda3HNrCa4+yZJC1EmRsSH7D/LKzvY7RUz0cWk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NEYb6zRsp0NakClzhMLML28cG2myWg5tWy1NIsJHBnXjy2lVQ3isZr3qtTLQu3i3b5zhHCcXK0dx9WmBKCI5JIBDD5KRroD/9MTTrp+bnU/m7SY9B2XvRyLFDsxUxbr2vYXdPbCyOLf8JrZvu2+JSdX1irjP0L7eWMyVLj8eOi0= 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=Kgjc60X9; arc=none smtp.client-ip=192.198.163.18 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="Kgjc60X9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602652; x=1756138652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xU/utmda3HNrCa4+yZJC1EmRsSH7D/LKzvY7RUz0cWk=; b=Kgjc60X9OLJ9sJOpG7YCafe9vf57v3w+RIWqBHCwXmHoHRTFKv/MAARF 0PfF1WZWwg7zv0Du4cjp6bGFWaABG/7Bh7DMpHNdDJJr+nBSDUYSJXvSc eHiDhqamQfFw5O9nZOsV7oyocIPCTqrK3vpotszYYxQ66mIkFpitrciLq xZjlqdkP4TVcDoTIw08tvyDBTohWH2+bDGu4ExX9D0fX37rCg14bWO1Sr 5Qb0kzxqdXcSL2Db6AVn+mvQPJLUsoL0hBVSv2fh9EVfmPxgCmq93MyaS evuA1NWu/SeYj4jGE2wM4V+1oA0eOqg3HFXrf79BkLHfUZmNxofwN1U6a A==; X-CSE-ConnectionGUID: +DGvjm8hT4amsd02+7ghDw== X-CSE-MsgGUID: emFN3YSvScGPcLLyPyKcIw== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544127" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544127" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:32 -0700 X-CSE-ConnectionGUID: jjk3bUemQjqJvMW49+KGTA== X-CSE-MsgGUID: viVKQj7aT0a4mFQZ2fXXlg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999745" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:30 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Ilan Peer Subject: [PATCH 06/13] wifi: iwlwifi: mvm: fix iwl_mvm_max_scan_ie_fw_cmd_room() Date: Sun, 25 Aug 2024 19:17:06 +0300 Message-Id: <20240825191257.e710ce446b7f.I2715c6742e9c3d160e2ba41bc4b35de370d2ce34@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 Driver creates also the WFA TPC element, consider that in the calculation. Signed-off-by: Daniel Gabay Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index ecd9d301e88b..bae6aec8295c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -48,6 +48,8 @@ /* Number of iterations on the channel for mei filtered scan */ #define IWL_MEI_SCAN_NUM_ITER 5U +#define WFA_TPC_IE_LEN 9 + struct iwl_mvm_scan_timing_params { u32 suspend_time; u32 max_out_time; @@ -303,8 +305,8 @@ static int iwl_mvm_max_scan_ie_fw_cmd_room(struct iwl_mvm *mvm) max_probe_len = SCAN_OFFLOAD_PROBE_REQ_SIZE; - /* we create the 802.11 header and SSID element */ - max_probe_len -= 24 + 2; + /* we create the 802.11 header SSID element and WFA TPC element */ + max_probe_len -= 24 + 2 + WFA_TPC_IE_LEN; /* DS parameter set element is added on 2.4GHZ band if required */ if (iwl_mvm_rrm_scan_needed(mvm)) @@ -731,8 +733,6 @@ static u8 *iwl_mvm_copy_and_insert_ds_elem(struct iwl_mvm *mvm, const u8 *ies, return newpos; } -#define WFA_TPC_IE_LEN 9 - static void iwl_mvm_add_tpc_report_ie(u8 *pos) { pos[0] = WLAN_EID_VENDOR_SPECIFIC; From patchwork Sun Aug 25 16:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823126 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 325F5155742 for ; Sun, 25 Aug 2024 16:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602656; cv=none; b=I9a0ZCSmh8LvGuLQT42lcVIWXUfW5OCkMDf6a+kPVDqDNAgkgy2MtjmGqfCOf67Q3/Z6UWWigqx1cGEWmUEwlWp5rK5zS87cju/ISehk3gVgklvUFAt5GhCnCrhJYuGJ3g+/ERTYwwwEQbnh+W0yH5tYBpYjMXeWZq2Ng4gsWfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602656; c=relaxed/simple; bh=E4eSGNBPOD2JYsEtUgEpWR17PVDKPzLnqyParV2+7ZE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qrOvMnAQmCrH7U7IJOFhZFp2OAYwmFWd/S08MR/+kIWuLrE9JfFBQHevX72osJihacVGvHhUFYS1JYxXnCALnP9kUbHRB9tsTesXNe/kl23pUZFVZ3wzGQxG4cei/B1V+lTpPbtopoIOho+h0QEZGKkSFYfm5Yku5eNeG7spyJQ= 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=HqBnmmVW; arc=none smtp.client-ip=192.198.163.18 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="HqBnmmVW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602654; x=1756138654; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E4eSGNBPOD2JYsEtUgEpWR17PVDKPzLnqyParV2+7ZE=; b=HqBnmmVWSMbl/BbS/bnkXYUSHXNOa7uDbGvyk3HC/o3K2OBgVUg5ucZ3 tRzKnTJxCFomHYWGXQf5gnJTEKpRqUXWlVGuQNi9e73nAD0FavzwnjK3a CTZFTeLg4HFD++3GUePnQs6IhRDtQySoyVo1rZNXl/U/qtPDBLY8RYOlX gmlWrBF5kVO23Uw5l2gGZqzanmyZgntlJwatu1M5Hw+1FP5wGOxdf1mxz V31QpwuOcLas7gscvwBgGxicAv6i82g2EcfFCczBBNA1IJSxP5Z4WJqV7 JD6Q7+rl3IhU7Cw9y90ooP6rn16CC4GpMQnTW1aQXbjRus1y27xaM8dhm w==; X-CSE-ConnectionGUID: TUU452BtQtm7FJKP+xoGGA== X-CSE-MsgGUID: 7BtFmIaWTBWgS2EnBKXkLQ== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544129" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544129" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:34 -0700 X-CSE-ConnectionGUID: /W5ypF8ISl6JetdEb+4d8w== X-CSE-MsgGUID: 70Oa70ZNQ2qWzquGXl0TMA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999749" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:32 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach , Ilan Peer Subject: [PATCH 07/13] wifi: iwlwifi: mvm: take the mutex before running link selection Date: Sun, 25 Aug 2024 19:17:07 +0300 Message-Id: <20240825191257.0cacecd5db1e.Iaca38a078592b69bdd06549daf63408ccf1810e4@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 iwl_mvm_select_links is called by the link selection worker and it requires the mutex. Take it in the link selection worker. This logic used to run from iwl_mvm_rx_umac_scan_complete_notif which had the mvm->mutex held. This was changed to run in a worker holding the wiphy mutex, but we also need the mvm->mutex. Fixes: 2e194efa3809 ("wifi: iwlwifi: mvm: Fix race in scan completion") Signed-off-by: Emmanuel Grumbach Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 1cc5667340e8..d809742528af 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1198,10 +1198,12 @@ static void iwl_mvm_trig_link_selection(struct wiphy *wiphy, struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, trig_link_selection_wk); + mutex_lock(&mvm->mutex); ieee80211_iterate_active_interfaces(mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_find_link_selection_vif, NULL); + mutex_unlock(&mvm->mutex); } static struct iwl_op_mode * From patchwork Sun Aug 25 16:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822427 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 B57932119 for ; Sun, 25 Aug 2024 16:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602657; cv=none; b=MCwhErgCEOR+91tkaZ98MudqJ+jGYFq0JZemoHjC29EFJVo7a9IgWHq8ywEffann1/GkQDNjkybCirI7b8EkD8D4lrlG7hIOXNquwKPgDSKeWBl2m3ud4EtMeZd1jlSo2YjUzdjLD3Twtvkc1zbcHkYAjteKM+nLmC22JijT0lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602657; c=relaxed/simple; bh=RyZV9UQsRGjtKkBm7cGAZaaQCuyDdF1zAQ4mBQORxGU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sMHmdcvtGemJbF9EfxpXK9cjcQsoIv5yCb7N8i71Ei34Rm5bEelcSDC9dNKYvxkIJ87R5VhLbFZj872m6cWrDAIZWh0rUtoghXZtlVKt6zrm2UsTlRrL9flZ18V5PDPmJWBCddHvl6tHnhkfnVadyesff2FtvJPDUvkvB2g40gs= 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=jZoulE0G; arc=none smtp.client-ip=192.198.163.18 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="jZoulE0G" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602655; x=1756138655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RyZV9UQsRGjtKkBm7cGAZaaQCuyDdF1zAQ4mBQORxGU=; b=jZoulE0GyrGELcsFujeHxEMUP0UMCQWVFSqm8nW8lmgM7yXYHLVQz9Ue 7Y5Xvhyxh9upWBuVGTzaqoXIB1jEclG02HZBSdqvrVB5ygDscBMZlQAOW myDRx4rMDLwuwngg2aOtRlFRzpDCzR6l3jGTVDn5WLtZy64j4Kp+UWf+2 9Dn0RHtcH/QJI+TZL6FELcem6CZoFhQsKj2Ji3jd+Qxd6FGxhr9UuJblb 2YasklxKCAgVi5sqIrzanMxe0yPt3+nJXHYQI4gupK0db5j/jBRAO7Hl/ i+G+nFujDvFHC+suWX12Fmlfy9I7ARR3PG1sR0slE5/wRtymdUcDgH/Tu w==; X-CSE-ConnectionGUID: RuQJmindRcyX4oRDAZBARQ== X-CSE-MsgGUID: EXv4LTUqQdKw23Xi2dCKHg== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544132" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544132" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:35 -0700 X-CSE-ConnectionGUID: d4QTzOSMQauYx2m4WI9p4Q== X-CSE-MsgGUID: GwLi499rT6am1m0jSzGuGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999754" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:34 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 08/13] wifi: iwlwifi: fw: fix wgds rev 3 exact size Date: Sun, 25 Aug 2024 19:17:08 +0300 Message-Id: <20240825191257.cc71dfc67ec3.Ic27ee15ac6128b275c210b6de88f2145bd83ca7b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 Check size of WGDS revision 3 is equal to 8 entries size with some header, but doesn't dependent of no of entries. Check that no of entries should lie between min and max. Fixes: 97f8a3d1610b ("iwlwifi: ACPI: support revision 3 WGDS tables") Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 79774c8c7ff4..8c8880b44827 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -725,22 +725,25 @@ int iwl_acpi_get_wgds_table(struct iwl_fw_runtime *fwrt) entry = &wifi_pkg->package.elements[entry_idx]; entry_idx++; if (entry->type != ACPI_TYPE_INTEGER || - entry->integer.value > num_profiles) { + entry->integer.value > num_profiles || + entry->integer.value < + rev_data[idx].min_profiles) { ret = -EINVAL; goto out_free; } - num_profiles = entry->integer.value; /* - * this also validates >= min_profiles since we - * otherwise wouldn't have gotten the data when - * looking up in ACPI + * Check to see if we received package count + * same as max # of profiles */ if (wifi_pkg->package.count != hdr_size + profile_size * num_profiles) { ret = -EINVAL; goto out_free; } + + /* Number of valid profiles */ + num_profiles = entry->integer.value; } goto read_table; } From patchwork Sun Aug 25 16:17:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822426 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 CC5DE16F8E7 for ; Sun, 25 Aug 2024 16:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602661; cv=none; b=BVaVV6WV0QlpDNFW27tdLueJcecKcKaa9sWC8K60qtB+ZKEpbQNQh1O1kh89Zkul89qysAPhXma0U0bY8DESIaV+yiDFFnz/mBtG1kL1Ml7TIPxfMEqeRaJKOcCbJBjrY4WX6Bag6GcrK17lLRoQZSn1NL9XDuVfyyZlt+uuxVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602661; c=relaxed/simple; bh=tNyqzoZ5FVNN2rGcdvVUbIeID/wX5OShLQPVFu86mWg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NVrBwtcwkhVQ8xUv+alAH2fEznOXSH11E/bugzk9a/soQVj+d31cjylVzSpJjwwcVFpFu9haD1NPp3Xai2OObj0eiPgzA6AABUELCpkj5shAQJyX8BH7gX5fRf91Td3z6AbHhQG7IWBMY+0A5AYW0sDgxyC3clFMyjMIOifMFSs= 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=M6sIOJWL; arc=none smtp.client-ip=192.198.163.18 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="M6sIOJWL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602656; x=1756138656; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tNyqzoZ5FVNN2rGcdvVUbIeID/wX5OShLQPVFu86mWg=; b=M6sIOJWLBQDAfdoal+u/QgHnxsTXrxVKJiuDkWjdzfp/mVGMymsE4F9r Tz6MCyRj3eV8hu4cXstgzsqjCjsTdbRuzx+QcnsF/NSermFSaoguy+OJ4 Yjw2KPWn2ydBuhA60j+e4WQH2cYhJMAXsqf33URVpamV2iA2gUz4NlaLz QYzpRutW3kWhsIohjMbhnXI+Gai5dpdg7y8ySjpOSNLrYgc4rEEoyJhsC mQzjf7leS5sXKzwoSpz996QIhGzaz/zgt6PuudmjuZIBL1bE23zdsAJTu HCmfhMgimW+SV6bWcH82i0CWIEqJ6BjUuwo3bHwLyAq6Lt6AAOUq8kK3B g==; X-CSE-ConnectionGUID: 4RejxJi5R/2rixNAouyphg== X-CSE-MsgGUID: Eh1wLl+kTOykExah83n7Yg== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544134" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544134" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:36 -0700 X-CSE-ConnectionGUID: j6EBxkXSSsGmzBKkKcVfEg== X-CSE-MsgGUID: CYiojWsxRX2+rMWHQRX4nQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999759" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:35 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 09/13] wifi: iwlwifi: mvm: avoid NULL pointer dereference Date: Sun, 25 Aug 2024 19:17:09 +0300 Message-Id: <20240825191257.880921ce23b7.I340052d70ab6d3410724ce955eb00da10e08188f@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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_tx_skb_sta() and iwl_mvm_tx_mpdu() verify that the mvmvsta pointer is not NULL. It retrieves this pointer using iwl_mvm_sta_from_mac80211, which is dereferencing the ieee80211_sta pointer. If sta is NULL, iwl_mvm_sta_from_mac80211 will dereference a NULL pointer. Fix this by checking the sta pointer before retrieving the mvmsta from it. If sta is not NULL, then mvmsta isn't either. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index 7ff5ea5e7aca..db926b2f4d8d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -1203,6 +1203,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, bool is_ampdu = false; int hdrlen; + if (WARN_ON_ONCE(!sta)) + return -1; + mvmsta = iwl_mvm_sta_from_mac80211(sta); fc = hdr->frame_control; hdrlen = ieee80211_hdrlen(fc); @@ -1210,9 +1213,6 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, if (IWL_MVM_NON_TRANSMITTING_AP && ieee80211_is_probe_resp(fc)) return -1; - if (WARN_ON_ONCE(!mvmsta)) - return -1; - if (WARN_ON_ONCE(mvmsta->deflink.sta_id == IWL_MVM_INVALID_STA)) return -1; @@ -1343,7 +1343,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb, struct ieee80211_sta *sta) { - struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); + struct iwl_mvm_sta *mvmsta; struct ieee80211_tx_info info; struct sk_buff_head mpdus_skbs; struct ieee80211_vif *vif; @@ -1352,9 +1352,11 @@ int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb, struct sk_buff *orig_skb = skb; const u8 *addr3; - if (WARN_ON_ONCE(!mvmsta)) + if (WARN_ON_ONCE(!sta)) return -1; + mvmsta = iwl_mvm_sta_from_mac80211(sta); + if (WARN_ON_ONCE(mvmsta->deflink.sta_id == IWL_MVM_INVALID_STA)) return -1; From patchwork Sun Aug 25 16:17:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823125 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 6CAAC2119 for ; Sun, 25 Aug 2024 16:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602659; cv=none; b=ll/Bg2O0iUHCxX0cx4/0ySPZg7OiXvh8Zn3vvWRHAGW99/ZPck1vTVAulh9Pkem5ijXb6tTAavSDr0dEBuYgu7de6ryHAZ4QHon6iwB/k2n4IZ6E8bHXFt8JSq0Y8PkwRESbDuyeToDHR4iwV4K0uq81BG56zJga36NvrqZTodc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602659; c=relaxed/simple; bh=N1x2yGxE4fIJH00NhIsyiBIx0/JvxgU/hxZWRcA8Oos=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fD+Jk7mLp0NC1arcYaIzQBx4GcgG/LiHa5jrvoZK6cnwVXsJPsa/63gJehP04hCZ1Y8fX6rAOmwilHQjEc38nSO/+Tn4JmUgV5OS2Vy+Tn6eEvvxboa8ZwtQ0L1Fyftb7rxQjElhqg13Spr0OFgvPGtn1j1ZPslHAWZAUEmfw7E= 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=VlV1xbWo; arc=none smtp.client-ip=192.198.163.18 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="VlV1xbWo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602658; x=1756138658; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=N1x2yGxE4fIJH00NhIsyiBIx0/JvxgU/hxZWRcA8Oos=; b=VlV1xbWo2TUz72DcfibbTrzZDA5Culu4ncHUV1NmIvn6/vskxYbvKNKq ZgYLbbBCpTan1jfklH4UWENaLw2Pm59IZqBwAbq9WXz3FZnETNqNYmbYL 1WtvSh+ak/5MNBdiYjbYF/jRBNQZh4nORXf6uF9IpftL803WXwYvJt2mv zzs9osjv+Wb6l3D7YQmn8Nrr1j/jiHb5UwHqUuCR+GDF+NoQ86qPd3CB7 TMSGKAiTQ3zrVVftqSC4w1O2NYhbDfOvBM9fFvzSfBV+DcwRxnDwSfdQu 0dCC8e5UDL8Vz0HQ34uxj5czIS9c0tvh5nS8gRZyhjlaISY/tWrE5pGNc Q==; X-CSE-ConnectionGUID: hdCHA+5lSxWcgp0/Itahew== X-CSE-MsgGUID: NBWVMTkoTKyIfK31fBUpQw== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544137" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544137" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:38 -0700 X-CSE-ConnectionGUID: AyAug1fvS36QKf6fUkruLA== X-CSE-MsgGUID: 0YPu3TaxTjyhOg3LRu5GuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999764" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:36 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 10/13] wifi: iwlwifi: mvm: pause TCM when the firmware is stopped Date: Sun, 25 Aug 2024 19:17:10 +0300 Message-Id: <20240825191257.5abe71ca1b6b.I97a968cb8be1f24f94652d9b110ecbf6af73f89e@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 Not doing so will make us send a host command to the transport while the firmware is not alive, which will trigger a WARNING. bad state = 0 WARNING: CPU: 2 PID: 17434 at drivers/net/wireless/intel/iwlwifi/iwl-trans.c:115 iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] RIP: 0010:iwl_trans_send_cmd+0x1cb/0x1e0 [iwlwifi] Call Trace: iwl_mvm_send_cmd+0x40/0xc0 [iwlmvm] iwl_mvm_config_scan+0x198/0x260 [iwlmvm] iwl_mvm_recalc_tcm+0x730/0x11d0 [iwlmvm] iwl_mvm_tcm_work+0x1d/0x30 [iwlmvm] process_one_work+0x29e/0x640 worker_thread+0x2df/0x690 ? rescuer_thread+0x540/0x540 kthread+0x192/0x1e0 ? set_kthread_struct+0x90/0x90 ret_from_fork+0x22/0x30 Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index d809742528af..a8590c453ab3 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1513,6 +1513,8 @@ void iwl_mvm_stop_device(struct iwl_mvm *mvm) clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); + iwl_mvm_pause_tcm(mvm, false); + iwl_fw_dbg_stop_sync(&mvm->fwrt); iwl_trans_stop_device(mvm->trans); iwl_free_fw_paging(&mvm->fwrt); From patchwork Sun Aug 25 16:17:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823124 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 076741684A5 for ; Sun, 25 Aug 2024 16:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602661; cv=none; b=hPd9RR3Vx+AC1FshHsqxcEHMoQKzHgIadGn351XmQi93FNZRr3GokSQqozMlovTA6NLfA+m2iIa2Lh8aMKxq4XZI1KrUQIltZ67aJ9bTo3atzOpcSe16UwPJw+S/GVJoXy274azDvh3mQX/tBHlTDaR0TY6sWLOg/zYErwrHIjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602661; c=relaxed/simple; bh=OTD20n4QXpcTpqMfiY0mToN8nzrgchIfV9FgB7V//Qg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HS1QD9VcFx4tRSjsubyRqJMzyD4FNg0BCv93XrvweAkXKek3wQAMorpp1QK39Mhsx1PW9q44dwyGqRe2zzB6U5emN4sOnsg0ex1C3zMdJQhfE+pb5D3TDFZsY12QqwPqcqI3BENfWl4d+qxPoHXga/m9yLiKC+QJYmAyx9AlKnw= 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=COPdr7XU; arc=none smtp.client-ip=192.198.163.18 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="COPdr7XU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602660; x=1756138660; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OTD20n4QXpcTpqMfiY0mToN8nzrgchIfV9FgB7V//Qg=; b=COPdr7XU6ip3wOasXWhLR5+hddHhLj9ITRlrx26mh7sg0rQL+aI851vN iJ3ow/9X6AiwbHiFpFI69UEReH2TpKyY3q2isFwDAWYIugDjyga5si5IL BvaUnY2esyUmcYtbQ3ASv8SFIfWA9CFUwuExKNSLRAAqNQcptxvj2e/c3 auvEPZ9ATwrF8khYtAmgImhxjwfIIP8ZQ2htisZM81ze+QfMEwN5raKnl awUqiA0OTUuZCVgzA9lF5MlletOHT5BANRYHKK4ujgppLHX7QVBK9vjaL hzqUBDjOLEQrfUECLXxBgvvYkjOZOs5PsPFHg4nQO9JJXjlgiDM18x5LS Q==; X-CSE-ConnectionGUID: L7c5w1iTQseZ9JBlMlgUrw== X-CSE-MsgGUID: Nikdf4fwQTKX5T+RYXfNAQ== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544140" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544140" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:39 -0700 X-CSE-ConnectionGUID: A0q0/0PSRoiJMoI+JEiYCg== X-CSE-MsgGUID: TKOnKOC6RMSj5iD1/SNjpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999768" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:38 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 11/13] wifi: iwlwifi: mvm: allow ESR when we the ROC expires Date: Sun, 25 Aug 2024 19:17:11 +0300 Message-Id: <20240825191257.8f8765f359cc.I16fcd6198072d422ff36dce68070aafaf011f4c1@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 We forgot to release the ROC reason for ESR prevention when the remain on channel expires. Add this. Fixes: a1efeb823084 ("wifi: iwlwifi: mvm: Block EMLSR when a p2p/softAP vif is active") Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/mvm/time-event.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c index a8c42ce3b630..72fa7ac86516 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -114,16 +114,14 @@ static void iwl_mvm_cleanup_roc(struct iwl_mvm *mvm) iwl_mvm_flush_sta(mvm, mvm->aux_sta.sta_id, mvm->aux_sta.tfd_queue_msk); - if (mvm->mld_api_is_used) { - iwl_mvm_mld_rm_aux_sta(mvm); - mutex_unlock(&mvm->mutex); - return; - } - /* In newer version of this command an aux station is added only * in cases of dedicated tx queue and need to be removed in end - * of use */ - if (iwl_mvm_has_new_station_api(mvm->fw)) + * of use. For the even newer mld api, use the appropriate + * function. + */ + if (mvm->mld_api_is_used) + iwl_mvm_mld_rm_aux_sta(mvm); + else if (iwl_mvm_has_new_station_api(mvm->fw)) iwl_mvm_rm_aux_sta(mvm); } From patchwork Sun Aug 25 16:17:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 822425 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 850171714B2 for ; Sun, 25 Aug 2024 16:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602662; cv=none; b=l7EYRaWtN+tlEsekG/SWgXCGDwoye41l3xP6zfvYsBmRNehgo6HXzajluaUDHqmIECKfRTJolCJpOGOhY67DlK0K/s7bTEnI5DB7tyluaMzJZrPAxWUYLtHdayQ1ykploEb4g/dOKgOkJqJgXCH+glwn4wEGU5WHebe2xgTAIms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602662; c=relaxed/simple; bh=dukzQzawHxZkgtSzm9gPMQY9ZXrl7MkzY+TNt63181s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a7CfFa8t/lYJwdRj8+QJHlgCnHCqjdnGEhbd5DWIXbMOJwMiQTvBVRWm08sI+1Ukztk8EE9+fteKnpTKrysRhbraVmpJMWwpwmRV8jaVAiC//7FFD7mbdM58j0XLqJMXl7ff1I5VXdCL1OvZ2eSl5z8fbKrx2Ua2DFaqcSRVAAE= 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=Xo3HEi6k; arc=none smtp.client-ip=192.198.163.18 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="Xo3HEi6k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602661; x=1756138661; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dukzQzawHxZkgtSzm9gPMQY9ZXrl7MkzY+TNt63181s=; b=Xo3HEi6krH6ONf+jWDhKBLRqX+g0hqw5wehBrtWHv1OMv35/+A5Xd4sW 748g6vqFfKaePlKSPLqgR1PJQNgYGFzILbcbfYgA2eHTwZPt23aKo0Hzy hFCGS21ScBFv2C86ElHemf+ZHMo/GXp35HDQI6P+tw+75J1wvcgGQLL+H 1R/NKfN3HYkJHtmxh/oUytiWSRDkbnFNv+2ueo13EqaRuhlMDv3EXKXmc nunKsNQuSZw2zNeAyVYScRPm6NdQQQpB4/T1udUwIKzurBaWIj0EseLh6 P409zejGXaW8I66bANxNvmrj/RgnPg6Bn6yc50UrT5hOG61XyvMpAD2zx Q==; X-CSE-ConnectionGUID: VllcbxGsS3igOMdnFckBhQ== X-CSE-MsgGUID: ihVo1UwiT1ifMWLA40xpug== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544143" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544143" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:41 -0700 X-CSE-ConnectionGUID: y2iDyjkWRRyTf99HIflZ2w== X-CSE-MsgGUID: ZVuGyhhzRqCOys9KtFEVrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999772" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:39 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 12/13] wifi: iwlwifi: mvm: allow 6 GHz channels in MLO scan Date: Sun, 25 Aug 2024 19:17:12 +0300 Message-Id: <20240825191257.04807f8213b2.Idd09d4366df92a74853649c1a520b7f0f752d1ac@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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: Avraham Stern MLO internal scan may include 6 GHz channels. Since the 6 GHz scan indication is not set, the channel flags are set incorrectly, which leads to a firmware assert. Since the MLO scan may include 6 GHz and non 6 GHz channels in one request, add support for non-PSC 6 GHz channels (PSC channels are already supported) when the 6 GHz indication is not set. Fixes: 38b3998dfba3 ("wifi: iwlwifi: mvm: Introduce internal MLO passive scan") Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c index bae6aec8295c..1cc9c426bb15 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c @@ -1659,6 +1659,17 @@ iwl_mvm_umac_scan_cfg_channels_v7(struct iwl_mvm *mvm, cfg->v2.channel_num = channels[i]->hw_value; if (cfg80211_channel_is_psc(channels[i])) cfg->flags = 0; + + if (band == NL80211_BAND_6GHZ) { + /* 6 GHz channels should only appear in a scan request + * that has scan_6ghz set. The only exception is MLO + * scan, which has to be passive. + */ + WARN_ON_ONCE(cfg->flags != 0); + cfg->flags = + cpu_to_le32(IWL_UHB_CHAN_CFG_FLAG_FORCE_PASSIVE); + } + cfg->v2.iter_count = 1; cfg->v2.iter_interval = 0; if (version < 17) From patchwork Sun Aug 25 16:17:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 823123 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 1512616C69F for ; Sun, 25 Aug 2024 16:17:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602664; cv=none; b=MyntpuQq8D9l3i4RkPmMwrcTPYXoZ9Pf0TV+cTeM9Dzp8Esq9dTrf9KU3DdLs0cdSJjrWCF8ebk9S+tGtmE2JU8xl4fjbrhiH/uy6LzZgEq15bMwjNQ1zVvCcRL0ZNM7G02lBlGgVYL0ASkK72Eh6ocQc3w5/U/0VIlyICPn7Hw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724602664; c=relaxed/simple; bh=5+/5RQtPIdgaFLUsgktHurwx0SOYM+UCMdKn24w2oyc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vCMYTfpKkmovmuUfRUuWjSgWapFiuRZwIaUyb+yntK//5OwOFeUKssJXcpu3DLu5i1dNI3pJvGBIKEBMGMN8USYpc9y3P5vAjZc9X+ZepRbWs8zd7C0uulyXizacQn6TwkABB3dS5ER9W0Mqm76tUSH4wk4CEyRzZmgbpI+pmsA= 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=OifCq/TE; arc=none smtp.client-ip=192.198.163.18 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="OifCq/TE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1724602663; x=1756138663; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5+/5RQtPIdgaFLUsgktHurwx0SOYM+UCMdKn24w2oyc=; b=OifCq/TEQimytRsx7sBachNAvd2Q2PGQpsd1/vsTPLbzx+ZICUi7uI09 GtZAZZZzsdDTh8QRXZP8j0CT8Z7OCIt5yst3IXZGUBngDZAveeDMi13U8 jO4+hvnFQ1u824bwgGykY1eTb+tjQ7K9M8wU/YQIhqw403xsoph2jCVeJ Ipv/8q2z1NbQODYJycQijdNyJjs8z+7YHuiUjlOqMGr+AlQwS4x+fmQsT JxFRCxErnemNKk6WaC7IRW0tHQArgytd2QGT5dFvOSO18zYDUhbzFqVaE P8YNHV9G5uyum+HK673xfoL2CWL6kvtb5wXae4zd1zqnP9JhbSYZfeZ1J w==; X-CSE-ConnectionGUID: UNaR1QJcQTiV/sMjY2jAnw== X-CSE-MsgGUID: kA50u9KRTlC3IXgbIXDLJw== X-IronPort-AV: E=McAfee;i="6700,10204,11175"; a="22544145" X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="22544145" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:42 -0700 X-CSE-ConnectionGUID: WbpRiNszTz+NR9R2zNmQCg== X-CSE-MsgGUID: HPYfM5DyTOS+GlB1BdQZfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,175,1719903600"; d="scan'208";a="62999777" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2024 09:17:41 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Len Brown Subject: [PATCH 13/13] wifi: iwlwifi: lower message level for FW buffer destination Date: Sun, 25 Aug 2024 19:17:13 +0300 Message-Id: <20240825191257.20abf78f05bc.Ifbcecc2ae9fb40b9698302507dcba8b922c8d856@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240825161713.3547021-1-miriam.rachel.korenblit@intel.com> References: <20240825161713.3547021-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 An invalid buffer destination is not a problem for the driver and it does not make sense to report it with the KERN_ERR message level. As such, change the message to use IWL_DEBUG_FW. Reported-by: Len Brown Closes: https://lore.kernel.org/r/CAJvTdKkcxJss=DM2sxgv_MR5BeZ4_OC-3ad6tA40TYH2yqHCWw@mail.gmail.com Signed-off-by: Benjamin Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 e63efbf809f0..ae93a72542b2 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c @@ -89,7 +89,8 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, } break; default: - IWL_ERR(trans, "WRT: Invalid buffer destination\n"); + IWL_DEBUG_FW(trans, "WRT: Invalid buffer destination (%d)\n", + le32_to_cpu(fw_mon_cfg->buf_location)); } out: if (dbg_flags)