From: Ashwin Gundarapu <linuxuser509@zohomail.in>
To: miriam.rachel.korenblit@intel.com, johannes.berg@intel.com
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] wifi: iwlwifi: add retry loop for firmware reload on resume
Date: Tue, 5 May 2026 19:29:54 +0530 [thread overview]
Message-ID: <bbce7585-aa31-475f-98be-4151e7b18bcf@zohomail.in> (raw)
From 48670d4341d2a9187e8368a2a929d155c4ffd003 Mon Sep 17 00:00:00 2001
From: Ashwin Gundarapu <linuxuser509@zohomail.in>
Date: Tue, 5 May 2026 19:12:48 +0530
Subject: [PATCH] wifi: iwlwifi: add retry loop for firmware reload on resume
After suspend, the PCIe link may not be fully ready when the driver
attempts to reload firmware. This causes iwlwifi to fail silently,
leaving users with no WiFi until reboot.
Add a retry loop that attempts firmware reload up to 3 times with
a 100ms delay between attempts, replacing the previous single attempt
that the code itself described as 'hope for the best here.'
---
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index dc99e7ac4726..2208b06d7e63 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1257,14 +1257,20 @@ static int _iwl_pci_resume(struct device
*device, bool restore)
if (restore || device_was_powered_off) {
trans->state = IWL_TRANS_NO_FW;
- /* Hope for the best here ... If one of those steps fails we
- * won't really know how to recover.
+ /* Retry firmware reload up to 3 times.
+ * The PCIe link may not be fully ready on the first attempt
+ * after resume, causing iwlwifi to fail silently.
*/
- iwl_pcie_prepare_card_hw(trans);
- iwl_trans_activate_nic(trans);
+ int retry;
+ for (retry = 0; retry < 3; retry++) {
+ iwl_pcie_prepare_card_hw(trans);
+ iwl_trans_activate_nic(trans);
+ if (trans->state != IWL_TRANS_NO_FW)
+ break;
+ msleep(100);
+ }
iwl_op_mode_device_powered_off(trans->op_mode);
}
-
/* In WOWLAN, let iwl_trans_pcie_d3_resume do the rest of the
work */
if (test_bit(STATUS_DEVICE_ENABLED, &trans->status))
return 0;
base-commit: 26fd6bff2c050196005312d1d306889220952a99
prerequisite-patch-id: 039ce4200f5ab50b86e8ef1fea9d93294ae43517
--
2.43.0
reply other threads:[~2026-05-05 14:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bbce7585-aa31-475f-98be-4151e7b18bcf@zohomail.in \
--to=linuxuser509@zohomail.in \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox