2021-12-19 09:01:35

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 0/4] iwlwifi: fixes for new W=1 warnings and errors

From: Luca Coelho <[email protected]>

Hi Kalle,

As agreed, here are the patches to fix the W=1 warnings and errors
reported by Jacub.

Please take them directly to wireless-drivers-next as we discussed.

Thanks!

Cheers,
Luca.


Johannes Berg (3):
iwlwifi: mei: fix W=1 warnings
iwlwifi: mvm: add missing min_size to kernel-doc
iwlwifi: mvm: add dbg_time_point to debugfs

Luca Coelho (1):
iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()

drivers/net/wireless/intel/iwlwifi/mei/main.c | 10 ++++++----
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 +++
3 files changed, 10 insertions(+), 4 deletions(-)

--
2.34.1



2021-12-19 09:01:36

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 1/4] iwlwifi: mei: fix W=1 warnings

From: Johannes Berg <[email protected]>

There are a few warnings due to kernel-doc not understanding
the constructs the way they're done here, fix them.

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

diff --git a/drivers/net/wireless/intel/iwlwifi/mei/main.c b/drivers/net/wireless/intel/iwlwifi/mei/main.c
index 4453cd2571c2..15b207d61ae6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mei/main.c
+++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c
@@ -175,7 +175,7 @@ struct iwl_mei {
};

/**
- * iwl_mei_cache - cache for the parameters from iwlwifi
+ * struct iwl_mei_cache - cache for the parameters from iwlwifi
* @ops: Callbacks to iwlwifi.
* @netdev: The netdev that will be used to transmit / receive packets.
* @conn_info: The connection info message triggered by iwlwifi's association.
@@ -191,7 +191,7 @@ struct iwl_mei {
* is cached here so that we can buffer the configuration even if we don't have
* a bind from the mei bus and hence, on iwl_mei structure.
*/
-static struct {
+struct iwl_mei_cache {
const struct iwl_mei_ops *ops;
struct net_device __rcu *netdev;
const struct iwl_sap_notif_connection_info *conn_info;
@@ -201,7 +201,9 @@ static struct {
u8 mac_address[6];
u8 nvm_address[6];
void *priv;
-} iwl_mei_cache = {
+};
+
+static struct iwl_mei_cache iwl_mei_cache = {
.rf_kill = SAP_HW_RFKILL_DEASSERTED | SAP_SW_RFKILL_DEASSERTED
};

@@ -1781,7 +1783,7 @@ static void iwl_mei_dbgfs_unregister(struct iwl_mei *mei) {}

#endif /* CONFIG_DEBUG_FS */

-/**
+/*
* iwl_mei_probe - the probe function called by the mei bus enumeration
*
* This allocates the data needed by iwlmei and sets a pointer to this data
--
2.34.1


2021-12-19 09:01:38

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 2/4] iwlwifi: mvm: add missing min_size to kernel-doc

From: Johannes Berg <[email protected]>

On struct iwl_rx_handlers we should document the min_size
member, do that.

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

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index f12e571d3581..9bd869b8a974 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -257,6 +257,7 @@ enum iwl_rx_handler_context {
/**
* struct iwl_rx_handlers handler for FW notification
* @cmd_id: command id
+ * @min_size: minimum size to expect for the notification
* @context: see &iwl_rx_handler_context
* @fn: the function is called when notification is received
*/
--
2.34.1


2021-12-19 09:01:39

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 3/4] iwlwifi: mvm: add dbg_time_point to debugfs

From: Johannes Berg <[email protected]>

We forgot to link this to debugfs, so the code is all dead.
Add it for real.

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

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index f1e9d2c99051..fb4920b01dbb 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -2072,6 +2072,7 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm)
MVM_DEBUGFS_ADD_FILE(prph_reg, mvm->debugfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE(fw_dbg_conf, mvm->debugfs_dir, 0600);
MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, 0200);
+ MVM_DEBUGFS_ADD_FILE(dbg_time_point, mvm->debugfs_dir, 0200);
MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, 0200);
MVM_DEBUGFS_ADD_FILE(indirection_tbl, mvm->debugfs_dir, 0200);
MVM_DEBUGFS_ADD_FILE(inject_packet, mvm->debugfs_dir, 0200);
--
2.34.1


2021-12-19 09:01:40

by Luca Coelho

[permalink] [raw]
Subject: [PATCH 4/4] iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()

From: Luca Coelho <[email protected]>

If iwl_transt_start_hw() failed, we were returning without calling
wiphy_unlock() and rtnl_unlock(), causing a locking imbalance:

drivers/net/wireless/intel/iwlwifi/mvm/ops.c:686:12: warning: context imbalance in 'iwl_mvm_start_get_nvm' - wrong count at exit

Fix that by adding the unlock calls.

Signed-off-by: Luca Coelho <[email protected]>
---
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 9bd869b8a974..3941baa3eda3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -718,6 +718,8 @@ static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm)
ret = iwl_trans_start_hw(mvm->trans);
if (ret) {
mutex_unlock(&mvm->mutex);
+ wiphy_unlock(mvm->hw->wiphy);
+ rtnl_unlock();
return ret;
}

--
2.34.1


2021-12-20 18:41:46

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 1/4] iwlwifi: mei: fix W=1 warnings

Luca Coelho <[email protected]> wrote:

> From: Johannes Berg <[email protected]>
>
> There are a few warnings due to kernel-doc not understanding
> the constructs the way they're done here, fix them.
>
> Signed-off-by: Johannes Berg <[email protected]>
> Signed-off-by: Luca Coelho <[email protected]>

4 patches applied to wireless-drivers-next.git, thanks.

991bbbeccc24 iwlwifi: mei: fix W=1 warnings
80cba44ff61b iwlwifi: mvm: add missing min_size to kernel-doc
ab2c42618ab9 iwlwifi: mvm: add dbg_time_point to debugfs
97c0979d0d72 iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()

--
https://patchwork.kernel.org/project/linux-wireless/patch/iwlwifi.20211219110000.1ef2bb24771c.I6a59ad2d64f719d3e27398951c8f1b678b0b1092@changeid/

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