2022-03-04 18:51:13

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 00/13] iwlwifi: updates intended for v5.18 2022-03-04

From: Luca Coelho <[email protected]>

Hi,

Here's the seventh set of patches intended for v5.18. It's the usual
development, new features, cleanups and bugfixes.

The changes are:

* Mostly debugging infra changes;
* Some more work on the Bz family of devices;
* Bump the FW API twice;
* Some other small fixes, clean-ups and improvements.

There are two FW API dumps here. We have loads of patches going to
v5.18, so we actually bumped the FW API version supported quite a bit.
I was debating whether to do the bump in one go, but since we're not
sure whether FW API version 72 will be released publicly, I decided to
keep it in two patches for easier reverting. Even if we do end up
releasing version 72 (which we probably will), it's still easier to
bisect if we bump twice, in different patches.

As usual, I'm pushing this to a pending branch, for kbuild bot, and
will send a pull-request later.

Please review.

Cheers,
Luca.


Ayala Barazani (2):
iwlwifi: mvm: add a flag to reduce power command.
iwlwifi: Configure FW debug preset via module param.

Johannes Berg (3):
iwlwifi: mvm: remove cipher scheme support
iwlwifi: pcie: fix SW error MSI-X mapping
iwlwifi: use 4k queue size for Bz A-step

Luca Coelho (2):
iwlwifi: bump FW API to 71 for AX devices
iwlwifi: bump FW API to 72 for AX devices

Matt Chen (1):
iwlwifi: acpi: move ppag code from mvm to fw/acpi

Mordechay Goodstein (2):
iwlwifi: dbg: in sync mode don't call schedule
iwlwifi: dbg: check trigger data before access

Mukesh Sisodiya (3):
iwlwifi: yoyo: disable IMR DRAM region if IMR is disabled
iwlwifi: mvm: add support for IMR based on platform
iwlwifi: yoyo: dump IMR DRAM only for HW and FW error

.../net/wireless/intel/iwlwifi/cfg/22000.c | 19 +-
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 211 ++++++++++++++++-
drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 28 +++
.../net/wireless/intel/iwlwifi/fw/api/power.h | 27 ++-
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 34 ++-
drivers/net/wireless/intel/iwlwifi/fw/file.h | 28 ---
drivers/net/wireless/intel/iwlwifi/fw/img.h | 12 -
.../net/wireless/intel/iwlwifi/fw/runtime.h | 3 +-
.../net/wireless/intel/iwlwifi/iwl-config.h | 5 +-
.../intel/iwlwifi/iwl-context-info-gen3.h | 4 +-
.../net/wireless/intel/iwlwifi/iwl-dbg-tlv.h | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 69 +++---
.../wireless/intel/iwlwifi/iwl-modparams.h | 5 +-
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 221 +++---------------
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 33 +--
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 -
.../intel/iwlwifi/pcie/ctxt-info-gen3.c | 5 +-
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 3 +-
.../net/wireless/intel/iwlwifi/pcie/trans.c | 2 +-
drivers/net/wireless/intel/iwlwifi/queue/tx.c | 4 +
20 files changed, 412 insertions(+), 306 deletions(-)

--
2.35.1


2022-03-04 19:19:39

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 13/13] iwlwifi: bump FW API to 72 for AX devices

From: Luca Coelho <[email protected]>

Start supporting API version 72 for AX devices.

Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
index 8afd5e16e5d8..8ff967edc8f0 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2021 Intel Corporation
+ * Copyright (C) 2018-2022 Intel Corporation
*/
#include <linux/module.h>
#include <linux/stringify.h>
@@ -10,7 +10,7 @@
#include "fw/api/txq.h"

/* Highest firmware API version supported */
-#define IWL_22000_UCODE_API_MAX 71
+#define IWL_22000_UCODE_API_MAX 72

/* Lowest firmware API version supported */
#define IWL_22000_UCODE_API_MIN 39
--
2.35.1

2022-03-04 19:50:51

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 09/13] iwlwifi: use 4k queue size for Bz A-step

From: Johannes Berg <[email protected]>

There's a hardware bug in Bz A-step that can be worked
around by using 4k queue size, so do that.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/queue/tx.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/queue/tx.c b/drivers/net/wireless/intel/iwlwifi/queue/tx.c
index 42e631cc16e8..726185d6fab8 100644
--- a/drivers/net/wireless/intel/iwlwifi/queue/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/queue/tx.c
@@ -1199,6 +1199,10 @@ int iwl_txq_dyn_alloc(struct iwl_trans *trans, u32 flags, u32 sta_mask,
};
int ret;

+ if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_BZ &&
+ trans->hw_rev_step == SILICON_A_STEP)
+ size = 4096;
+
txq = iwl_txq_dyn_alloc_dma(trans, size, timeout);
if (IS_ERR(txq))
return PTR_ERR(txq);
--
2.35.1

2022-03-04 20:09:15

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 05/13] iwlwifi: yoyo: disable IMR DRAM region if IMR is disabled

From: Mukesh Sisodiya <[email protected]>

Disable IMR region if it is enabled in the TLVs,
but disabled at runtime by the FW.

Signed-off-by: Mukesh Sisodiya <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 +++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index a178b83ee8a2..f4de8250696f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -124,6 +124,7 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
u32 lmac_error_event_table, umac_error_table;
u32 version = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
UCODE_ALIVE_NTFY, 0);
+ u32 i;

if (version == 6) {
struct iwl_alive_ntf_v6 *palive;
@@ -146,6 +147,28 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
mvm->trans->dbg.imr_data.imr_enable,
mvm->trans->dbg.imr_data.imr_size,
le64_to_cpu(mvm->trans->dbg.imr_data.imr_base_addr));
+
+ if (!mvm->trans->dbg.imr_data.imr_enable) {
+ for (i = 0; i < ARRAY_SIZE(mvm->trans->dbg.active_regions); i++) {
+ struct iwl_ucode_tlv *reg_tlv;
+ struct iwl_fw_ini_region_tlv *reg;
+
+ reg_tlv = mvm->trans->dbg.active_regions[i];
+ if (!reg_tlv)
+ continue;
+
+ reg = (void *)reg_tlv->data;
+ /*
+ * We have only one DRAM IMR region, so we
+ * can break as soon as we find the first
+ * one.
+ */
+ if (reg->type == IWL_FW_INI_REGION_DRAM_IMR) {
+ mvm->trans->dbg.unsupported_region_msk |= BIT(i);
+ break;
+ }
+ }
+ }
}

if (version >= 5) {
--
2.35.1

2022-03-04 20:13:31

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 07/13] iwlwifi: yoyo: dump IMR DRAM only for HW and FW error

From: Mukesh Sisodiya <[email protected]>

Support debug collection of the platform IMR memory region
only for HW and FW error. This region needs to be collected
as the last region.

Signed-off-by: Mukesh Sisodiya <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 25 +++++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index 108392234529..53f0fe77aa10 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -2430,6 +2430,9 @@ static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data reg_data = {
.dump_data = dump_data,
};
+ struct iwl_dump_ini_region_data imr_reg_data = {
+ .dump_data = dump_data,
+ };
int i;
u32 size = 0;
u64 regions_mask = le64_to_cpu(trigger->regions_mask) &
@@ -2465,10 +2468,32 @@ static u32 iwl_dump_ini_trigger(struct iwl_fw_runtime *fwrt,
tp_id);
continue;
}
+ /*
+ * DRAM_IMR can be collected only for FW/HW error timepoint
+ * when fw is not alive. In addition, it must be collected
+ * lastly as it overwrites SRAM that can possibly contain
+ * debug data which also need to be collected.
+ */
+ if (reg_type == IWL_FW_INI_REGION_DRAM_IMR) {
+ if (tp_id == IWL_FW_INI_TIME_POINT_FW_ASSERT ||
+ tp_id == IWL_FW_INI_TIME_POINT_FW_HW_ERROR)
+ imr_reg_data.reg_tlv = fwrt->trans->dbg.active_regions[i];
+ else
+ IWL_INFO(fwrt,
+ "WRT: trying to collect DRAM_IMR at time point: %d, skipping\n",
+ tp_id);
+ /* continue to next region */
+ continue;
+ }
+

size += iwl_dump_ini_mem(fwrt, list, &reg_data,
&iwl_dump_ini_region_ops[reg_type]);
}
+ /* collect DRAM_IMR region in the last */
+ if (imr_reg_data.reg_tlv)
+ size += iwl_dump_ini_mem(fwrt, list, &reg_data,
+ &iwl_dump_ini_region_ops[IWL_FW_INI_REGION_DRAM_IMR]);

if (size)
size += iwl_dump_ini_info(fwrt, trigger, list);
--
2.35.1

2022-03-04 20:31:44

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 03/13] iwlwifi: Configure FW debug preset via module param.

From: Ayala Barazani <[email protected]>

The module param "enable_ini" is currently used to be enable/disable ini.
Add the option to configure the FW debug preset via this module param,
by change it type from boolean to an integer.

Signed-off-by: Ayala Barazani <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
.../net/wireless/intel/iwlwifi/iwl-dbg-tlv.h | 4 +-
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 41 +++++++++++++++++--
.../wireless/intel/iwlwifi/iwl-modparams.h | 5 ++-
3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
index 79287708bd6e..128059ca77e6 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2018-2021 Intel Corporation
+ * Copyright (C) 2018-2022 Intel Corporation
*/
#ifndef __iwl_dbg_tlv_h__
#define __iwl_dbg_tlv_h__
@@ -10,6 +10,8 @@
#include <fw/file.h>
#include <fw/api/dbg-tlv.h>

+#define IWL_DBG_TLV_MAX_PRESET 15
+
/**
* struct iwl_dbg_tlv_node - debug TLV node
* @list: list of &struct iwl_dbg_tlv_node
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index ab52136cffb4..f92bcab5fdf6 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1796,6 +1796,7 @@ void iwl_drv_stop(struct iwl_drv *drv)
kfree(drv);
}

+#define ENABLE_INI (IWL_DBG_TLV_MAX_PRESET + 1)

/* shared module parameters */
struct iwl_mod_params iwlwifi_mod_params = {
@@ -1803,7 +1804,7 @@ struct iwl_mod_params iwlwifi_mod_params = {
.bt_coex_active = true,
.power_level = IWL_POWER_INDEX_1,
.uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT,
- .enable_ini = true,
+ .enable_ini = ENABLE_INI,
/* the rest are 0 by default */
};
IWL_EXPORT_SYMBOL(iwlwifi_mod_params);
@@ -1915,10 +1916,42 @@ MODULE_PARM_DESC(nvm_file, "NVM file name");
module_param_named(uapsd_disable, iwlwifi_mod_params.uapsd_disable, uint, 0644);
MODULE_PARM_DESC(uapsd_disable,
"disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)");
-module_param_named(enable_ini, iwlwifi_mod_params.enable_ini,
- bool, S_IRUGO | S_IWUSR);
+
+static int enable_ini_set(const char *arg, const struct kernel_param *kp)
+{
+ int ret = 0;
+ bool res;
+ __u32 new_enable_ini;
+
+ /* in case the argument type is a number */
+ ret = kstrtou32(arg, 0, &new_enable_ini);
+ if (!ret) {
+ if (new_enable_ini > ENABLE_INI) {
+ pr_err("enable_ini cannot be %d, in range 0-16\n", new_enable_ini);
+ return -EINVAL;
+ }
+ goto out;
+ }
+
+ /* in case the argument type is boolean */
+ ret = kstrtobool(arg, &res);
+ if (ret)
+ return ret;
+ new_enable_ini = (res ? ENABLE_INI : 0);
+
+out:
+ iwlwifi_mod_params.enable_ini = new_enable_ini;
+ return 0;
+}
+
+static const struct kernel_param_ops enable_ini_ops = {
+ .set = enable_ini_set
+};
+
+module_param_cb(enable_ini, &enable_ini_ops, &iwlwifi_mod_params.enable_ini, 0644);
MODULE_PARM_DESC(enable_ini,
- "Enable debug INI TLV FW debug infrastructure (default: true");
+ "0:disable, 1-15:FW_DBG_PRESET Values, 16:enabled without preset value defined,"
+ "Debug INI TLV FW debug infrastructure (default: 16)");

/*
* set bt_coex_active to true, uCode will do kill/defer
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
index 004ebdac4535..d0b4d02bdab9 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2005-2014, 2018-2020 Intel Corporation
+ * Copyright (C) 2005-2014, 2018-2022 Intel Corporation
*/
#ifndef __iwl_modparams_h__
#define __iwl_modparams_h__
@@ -83,7 +83,8 @@ struct iwl_mod_params {
*/
bool disable_11ax;
bool remove_when_gone;
- bool enable_ini;
+ u32 enable_ini;
+ bool disable_11be;
};

static inline bool iwl_enable_rx_ampdu(void)
--
2.35.1

2022-03-04 20:45:02

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 10/13] iwlwifi: dbg: in sync mode don't call schedule

From: Mordechay Goodstein <[email protected]>

Today in the code we have two options for collecting data sync/schedule,
the two options call the same function and can lead to racing in free
resources after done.

So we call only one of two sync/schedule, and in case of sync only
call sync function without also schedule to immediately run as a side
job.

Signed-off-by: Mordechay Goodstein <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 4 ++--
1 file 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 53f0fe77aa10..d3ac8ea049a4 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -2992,10 +2992,10 @@ int iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt,
"WRT: Collecting data: ini trigger %d fired (delay=%dms).\n",
tp_id, (u32)(delay / USEC_PER_MSEC));

- schedule_delayed_work(&fwrt->dump.wks[idx].wk, usecs_to_jiffies(delay));
-
if (sync)
iwl_fw_dbg_collect_sync(fwrt, idx);
+ else
+ schedule_delayed_work(&fwrt->dump.wks[idx].wk, usecs_to_jiffies(delay));

return 0;
}
--
2.35.1