All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 08/15] wifi: iwlwifi: fw: don't always use FW dump trig
Date: Tue, 19 Mar 2024 10:10:20 +0200	[thread overview]
Message-ID: <20240319100755.e2976bc58b29.I72fbd6135b3623227de53d8a2bb82776066cb72b@changeid> (raw)
In-Reply-To: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

Since the dump_data (struct iwl_fwrt_dump_data) is a union,
it's not safe to unconditionally access and use the 'trig'
member, it might be 'desc' instead. Access it only if it's
known to be 'trig' rather than 'desc', i.e. if ini-debug
is present.

Fixes: 0eb50c674a1e ("iwlwifi: yoyo: send hcmd to fw after dump collection completes.")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index db6d7013df66..c3bdf433d8f7 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -3081,8 +3081,6 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
 	struct iwl_fw_dbg_params params = {0};
 	struct iwl_fwrt_dump_data *dump_data =
 		&fwrt->dump.wks[wk_idx].dump_data;
-	u32 policy;
-	u32 time_point;
 	if (!test_bit(wk_idx, &fwrt->dump.active_wks))
 		return;
 
@@ -3113,13 +3111,16 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
 
 	iwl_fw_dbg_stop_restart_recording(fwrt, &params, false);
 
-	policy = le32_to_cpu(dump_data->trig->apply_policy);
-	time_point = le32_to_cpu(dump_data->trig->time_point);
+	if (iwl_trans_dbg_ini_valid(fwrt->trans)) {
+		u32 policy = le32_to_cpu(dump_data->trig->apply_policy);
+		u32 time_point = le32_to_cpu(dump_data->trig->time_point);
 
-	if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
-		IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
-		iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
+		if (policy & IWL_FW_INI_APPLY_POLICY_DUMP_COMPLETE_CMD) {
+			IWL_DEBUG_FW_INFO(fwrt, "WRT: sending dump complete\n");
+			iwl_send_dbg_dump_complete_cmd(fwrt, time_point, 0);
+		}
 	}
+
 	if (fwrt->trans->dbg.last_tp_resetfw == IWL_FW_INI_RESET_FW_MODE_STOP_FW_ONLY)
 		iwl_force_nmi(fwrt->trans);
 
-- 
2.34.1


  parent reply	other threads:[~2024-03-19  8:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  8:10 [PATCH 00/15] wifi: iwlwifi: updates - 2024-03-19 Miri Korenblit
2024-03-19  8:10 ` [PATCH 01/15] wifi: iwlwifi: mvm: Introduce internal MLO passive scan Miri Korenblit
2024-03-19  8:10 ` [PATCH 02/15] wifi: iwlwifi: mvm: Add debugfs entry for triggering internal MLO scan Miri Korenblit
2024-03-19  8:10 ` [PATCH 03/15] wifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging request Miri Korenblit
2024-03-19  8:10 ` [PATCH 04/15] wifi: iwlwifi: add a kunit test for PCI table duplicates Miri Korenblit
2024-03-19  8:10 ` [PATCH 05/15] wifi: iwlwifi: mvm: rfi: fix potential response leaks Miri Korenblit
2024-03-19  8:10 ` [PATCH 06/15] wifi: iwlwifi: mvm: support iwl_dev_tx_power_cmd_v8 Miri Korenblit
2024-03-19  8:10 ` [PATCH 07/15] wifi: iwlwifi: mvm: always apply 6 GHz probe limitations Miri Korenblit
2024-03-19  8:10 ` Miri Korenblit [this message]
2024-03-19  8:10 ` [PATCH 09/15] wifi: iwlwifi: fw: add clarifying comments about iwl_fwrt_dump_data Miri Korenblit
2024-03-19  8:10 ` [PATCH 10/15] wifi: iwlwifi: read txq->read_ptr under lock Miri Korenblit
2024-03-19  8:10 ` [PATCH 11/15] wifi: iwlwifi: mvm: don't support puncturing in 5 GHz Miri Korenblit
2024-03-19  8:10 ` [PATCH 12/15] wifi: iwlwifi: remove 6 GHz NVM override Miri Korenblit
2024-03-19  8:10 ` [PATCH 13/15] wifi: iwlwifi: mvm: Do not warn on invalid link on scan complete Miri Korenblit
2024-03-19  8:10 ` [PATCH 14/15] wifi: iwlwifi: enable monitor on passive/inactive channels Miri Korenblit
2024-03-19  8:10 ` [PATCH 15/15] wifi: iwlwifi: mvm: allocate STA links only for active links Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240319100755.e2976bc58b29.I72fbd6135b3623227de53d8a2bb82776066cb72b@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.