All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "iwlwifi: remove wide_cmd_header field"
@ 2020-10-09  9:21 Luca Coelho
  2020-10-09 15:05 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Luca Coelho @ 2020-10-09  9:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, alexander, andy.lavr

From: Luca Coelho <luciano.coelho@intel.com>

This reverts commit 0a8159cbd11abf586693f1ec5264d0df587b71d8.

It turns out that this flag is used by iwldvm, so we can't get rid of
it.  This broke iwldvm devices with BAD_COMMAND errors.

Fixes: 0a8159cbd11a ("iwlwifi: remove wide_cmd_header field")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 2 +-
 drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 ++
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c   | 1 +
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c   | 5 +++++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
index a26da96763dd..becee92a5fd6 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
@@ -200,7 +200,7 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
 	if (!(cmd->flags & CMD_ASYNC))
 		lock_map_acquire_read(&trans->sync_cmd_lockdep_map);
 
-	if (!iwl_cmd_groupid(cmd->id))
+	if (trans->wide_cmd_header && !iwl_cmd_groupid(cmd->id))
 		cmd->id = DEF_ID(cmd->id);
 
 	ret = trans->ops->send_cmd(trans, cmd);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index b70294e9d07b..11a040e75bf3 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -968,6 +968,7 @@ struct iwl_trans_txqs {
  * @hw_id_str: a string with info about HW ID. Set during transport allocation.
  * @pm_support: set to true in start_hw if link pm is supported
  * @ltr_enabled: set to true if the LTR is enabled
+ * @wide_cmd_header: true when ucode supports wide command header format
  * @num_rx_queues: number of RX queues allocated by the transport;
  *	the transport must set this before calling iwl_drv_start()
  * @iml_len: the length of the image loader
@@ -1009,6 +1010,7 @@ struct iwl_trans {
 
 	const struct iwl_hcmd_arr *command_groups;
 	int command_groups_size;
+	bool wide_cmd_header;
 
 	u8 num_rx_queues;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 1e44a176b3d9..f1c5b3a9c26f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -761,6 +761,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 		trans_cfg.rx_buf_size = rb_size_default;
 	}
 
+	trans->wide_cmd_header = true;
 	trans_cfg.bc_table_dword =
 		mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
index 8c89e4a2f7f8..966be5689d63 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -1180,6 +1180,11 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
 	const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
 	u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
 
+	if (WARN(!trans->wide_cmd_header &&
+		 group_id > IWL_ALWAYS_LONG_GROUP,
+		 "unsupported wide command %#x\n", cmd->id))
+		return -EINVAL;
+
 	if (group_id != 0) {
 		copy_size = sizeof(struct iwl_cmd_header_wide);
 		cmd_size = sizeof(struct iwl_cmd_header_wide);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "iwlwifi: remove wide_cmd_header field"
  2020-10-09  9:21 [PATCH] Revert "iwlwifi: remove wide_cmd_header field" Luca Coelho
@ 2020-10-09 15:05 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-10-09 15:05 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless, alexander, andy.lavr

Luca Coelho <luca@coelho.fi> wrote:

> From: Luca Coelho <luciano.coelho@intel.com>
> 
> This reverts commit 0a8159cbd11abf586693f1ec5264d0df587b71d8.
> 
> It turns out that this flag is used by iwldvm, so we can't get rid of
> it.  This broke iwldvm devices with BAD_COMMAND errors.
> 
> Fixes: 0a8159cbd11a ("iwlwifi: remove wide_cmd_header field")
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

Patch applied to wireless-drivers-next.git, thanks.

b7d96bca1f00 Revert "iwlwifi: remove wide_cmd_header field"

-- 
https://patchwork.kernel.org/patch/11825443/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-09 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  9:21 [PATCH] Revert "iwlwifi: remove wide_cmd_header field" Luca Coelho
2020-10-09 15:05 ` Kalle Valo

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.