Subject: Re: linux-next: manual merge of the iwlwifi-next tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Thu, 8 May 2025 13:24:59 +1000

Hi Johannes,

On Wed, 07 May 2025 07:37:46 +0200 Johannes Berg <[email-masked]> wrote:
>
> > So, at your suggestion, I just used the latter versions of these files,
> > but I then got the following build failure:  
> 
> Ouch, sorry about that. That sounds like it's due to the duplicate
> commits you had pointed out, which Miri dropped from iwlwifi-next now.
> 
> On the plus side, I'm going to be the one who has to resolve these
> conflicts (soon) :)

There are real conficts (see below).

> > So, today I have merged the iwlwifi-next tree from next-20250505 (which
> > was effectively empty).  You may want to try merging the iwlwifi tree
> > into the iwlwifi-next tree and resolve any conflicts yourself (now that
> > the iwlwifi tree has been merged into Linus' tree).  
> 
> Not sure what you mean by "iwlwifi tree", I think iwlwifi-next/fixes was
> empty, so perhaps you meant "wireless tree" instead?

Yeah, that or just commit 175e69e33c66 (which has been merged into
Linus' tree).

> But yeah, I know what all the code is and what's going on, though
> evidently less than I thought after the recent updates.

So today, I have applied the following clean up patch, but it does mean
that the 2 commits mentioned from Linus' tree have been reverted in
linus-next.  This means that linux-next builds today with the
iwlwifi-next tree merged.

From: Stephen Rothwell <[email-masked]>
Date: Thu, 8 May 2025 12:26:09 +1000
Subject: [PATCH] iwlwifi: remove the left over bits of 2 commits from Linus' tree

Commits

  d49437a6afc7 ("wifi: iwlwifi: back off on continuous errors")
  15220a257319 ("wifi: iwlwifi: don't warn if the NIC is gone in resume")

were partly removed by just taking the MERGE_HAD versions of

  drivers/net/wireless/intel/iwlwifi/cfg/sc.c
  drivers/net/wireless/intel/iwlwifi/iwl-config.h
  drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
  drivers/net/wireless/intel/iwlwifi/iwl-trans.c
  drivers/net/wireless/intel/iwlwifi/iwl-trans.h
  drivers/net/wireless/intel/iwlwifi/pcie/drv.c
  drivers/net/wireless/intel/iwlwifi/tests/devinfo.c

This removes the rest.

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 .../net/wireless/intel/iwlwifi/pcie/internal.h   |  9 ++++-----
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c  | 16 ++++------------
 drivers/net/wireless/intel/iwlwifi/pcie/tx.c     |  2 +-
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
index b5368b256e20..8adeddeb0e4c 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
@@ -542,10 +542,10 @@ void iwl_trans_pcie_free(struct iwl_trans *trans);
 void iwl_trans_pcie_free_pnvm_dram_regions(struct iwl_dram_regions *dram_regions,
 					   struct device *dev);
 
-bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent);
-#define _iwl_trans_pcie_grab_nic_access(trans, silent)		\
+bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans);
+#define _iwl_trans_pcie_grab_nic_access(trans)			\
 	__cond_lock(nic_access_nobh,				\
-		    likely(__iwl_trans_pcie_grab_nic_access(trans, silent)))
+		    likely(__iwl_trans_pcie_grab_nic_access(trans)))
 
 void iwl_trans_pcie_check_product_reset_status(struct pci_dev *pdev);
 void iwl_trans_pcie_check_product_reset_mode(struct pci_dev *pdev);
@@ -1101,8 +1101,7 @@ void iwl_trans_pcie_set_bits_mask(struct iwl_trans *trans, u32 reg,
 int iwl_trans_pcie_read_config32(struct iwl_trans *trans, u32 ofs,
 				 u32 *val);
 bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans);
-void __releases(nic_access_nobh)
-iwl_trans_pcie_release_nic_access(struct iwl_trans *trans);
+void iwl_trans_pcie_release_nic_access(struct iwl_trans *trans);
 
 /* transport gen 1 exported functions */
 void iwl_trans_pcie_fw_alive(struct iwl_trans *trans);
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 799d651ddd8a..4d281c702eec 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2333,8 +2333,7 @@ void iwl_trans_pcie_reset(struct iwl_trans *trans, enum iwl_reset_mode mode)
 	struct iwl_trans_pcie_removal *removal;
 	char _msg = 0, *msg = &_msg;
 
-	if (WARN_ON(mode < IWL_RESET_MODE_REMOVE_ONLY ||
-		    mode == IWL_RESET_MODE_BACKOFF))
+	if (WARN_ON(mode < IWL_RESET_MODE_REMOVE_ONLY))
 		return;
 
 	if (test_bit(STATUS_TRANS_DEAD, &trans->status))
@@ -2388,7 +2387,7 @@ EXPORT_SYMBOL(iwl_trans_pcie_reset);
  * This version doesn't disable BHs but rather assumes they're
  * already disabled.
  */
-bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent)
+bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans)
 {
 	int ret;
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
@@ -2440,11 +2439,6 @@ bool __iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent)
 	if (unlikely(ret < 0)) {
 		u32 cntrl = iwl_read32(trans, CSR_GP_CNTRL);
 
-		if (silent) {
-			spin_unlock(&trans_pcie->reg_lock);
-			return false;
-		}
-
 		WARN_ONCE(1,
 			  "Timeout waiting for hardware access (CSR_GP_CNTRL 0x%08x)\n",
 			  cntrl);
@@ -2476,7 +2470,7 @@ bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans)
 	bool ret;
 
 	local_bh_disable();
-	ret = __iwl_trans_pcie_grab_nic_access(trans, false);
+	ret = __iwl_trans_pcie_grab_nic_access(trans);
 	if (ret) {
 		/* keep BHs disabled until iwl_trans_pcie_release_nic_access */
 		return ret;
@@ -2485,8 +2479,7 @@ bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans)
 	return false;
 }
 
-void __releases(nic_access_nobh)
-iwl_trans_pcie_release_nic_access(struct iwl_trans *trans)
+void iwl_trans_pcie_release_nic_access(struct iwl_trans *trans)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 
@@ -2513,7 +2506,6 @@ iwl_trans_pcie_release_nic_access(struct iwl_trans *trans)
 	 * scheduled on different CPUs (after we drop reg_lock).
 	 */
 out:
-	__release(nic_access_nobh);
 	spin_unlock_bh(&trans_pcie->reg_lock);
 }
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
index f142b8beb396..c876912e9aaf 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -1018,7 +1018,7 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans,
 	 * returned. This needs to be done only on NICs that have
 	 * apmg_wake_up_wa set (see above.)
 	 */
-	if (!_iwl_trans_pcie_grab_nic_access(trans, false))
+	if (!_iwl_trans_pcie_grab_nic_access(trans))
 		return -EIO;
 
 	/*
-- 
2.47.2

-- 
Cheers,
Stephen Rothwell