Skip to content

Commit 2244766

Browse files
egrumbachMiriam-Rachel
authored andcommitted
wifi: iwlwifi: if scratch is ~0U, consider it a failure
We want to see bits being set in the scratch register upon resume, but if all the bits are set, it means that we were kicked out of the PCI bus and that clearly doesn't mean we can assume the firmware is still alive after the suspend / resume cycle. Fixes: cb347bd ("wifi: iwlwifi: mvm: fix hibernation") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250828095500.0f203e559242.I59eff718cb5fda575db41081a1a389f7af488717@changeid
1 parent d9104ce commit 2244766

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • drivers/net/wireless/intel/iwlwifi/pcie

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,11 +1222,15 @@ static int _iwl_pci_resume(struct device *device, bool restore)
12221222
* Note: MAC (bits 0:7) will be cleared upon suspend even with wowlan,
12231223
* but not bits [15:8]. So if we have bits set in lower word, assume
12241224
* the device is alive.
1225+
* Alternatively, if the scratch value is 0xFFFFFFFF, then we no longer
1226+
* have access to the device and consider it powered off.
12251227
* For older devices, just try silently to grab the NIC.
12261228
*/
12271229
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) {
1228-
if (!(iwl_read32(trans, CSR_FUNC_SCRATCH) &
1229-
CSR_FUNC_SCRATCH_POWER_OFF_MASK))
1230+
u32 scratch = iwl_read32(trans, CSR_FUNC_SCRATCH);
1231+
1232+
if (!(scratch & CSR_FUNC_SCRATCH_POWER_OFF_MASK) ||
1233+
scratch == ~0U)
12301234
device_was_powered_off = true;
12311235
} else {
12321236
/*

0 commit comments

Comments
 (0)