Skip to content

Commit a530078

Browse files
egrumbachgregkh
authored andcommitted
wifi: iwlwifi: if scratch is ~0U, consider it a failure
[ Upstream commit 2244766 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent fb3cd55 commit a530078

File tree

1 file changed

+6
-2
lines changed
  • drivers/net/wireless/intel/iwlwifi/pcie

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,11 +1503,15 @@ static int _iwl_pci_resume(struct device *device, bool restore)
15031503
* Note: MAC (bits 0:7) will be cleared upon suspend even with wowlan,
15041504
* but not bits [15:8]. So if we have bits set in lower word, assume
15051505
* the device is alive.
1506+
* Alternatively, if the scratch value is 0xFFFFFFFF, then we no longer
1507+
* have access to the device and consider it powered off.
15061508
* For older devices, just try silently to grab the NIC.
15071509
*/
15081510
if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) {
1509-
if (!(iwl_read32(trans, CSR_FUNC_SCRATCH) &
1510-
CSR_FUNC_SCRATCH_POWER_OFF_MASK))
1511+
u32 scratch = iwl_read32(trans, CSR_FUNC_SCRATCH);
1512+
1513+
if (!(scratch & CSR_FUNC_SCRATCH_POWER_OFF_MASK) ||
1514+
scratch == ~0U)
15111515
device_was_powered_off = true;
15121516
} else {
15131517
/*

0 commit comments

Comments
 (0)